copy data from notpad and paste in excel using blue [prism

sivagelli

Well-Known Member
You can write code to read data from notepad file. Using the below suggestion, you can read the content of the notepad file on to Clipboard with out opening the file.

  • Create a object and add a code stage that accepts 'Path' as input. ('Path' is the full path of the notepad file)
  • Add code: Clipboard.SetText(File.ReadAllText(Path));
  • Publish the object
  • Save
These references needs to be added under the 'Code Options' tab of Initialise page for successful processing.
  • External References:
    • System.Windows.Forms.dll
  • Name Spaces:
    • System.Windows.Forms
    • System.IO
This action will copy the data to the clipboard. Now, you can write data from Clipboard in to a Data item using a Calc stage with expression 'GetClipboard()' . If you want to slice and dice the data in the Data Item, use related actions: Split lines, Split Text from String manipulations VBO.
On using these actions, the data will be written in to Collections. You can now write the data in collection to excel using 'Write Collection' action from MS Excel VBO.

Note: This line of code suggested works only for the notepad files.
 

subhash

Member
You can write code to read data from notepad file. Using the below suggestion, you can read the content of the notepad file on to Clipboard with out opening the file.

  • Create a object and add a code stage that accepts 'Path' as input. ('Path' is the full path of the notepad file)
  • Add code: Clipboard.SetText(File.ReadAllText(Path));
  • Publish the object
  • Save
These references needs to be added under the 'Code Options' tab of Initialise page for successful processing.
  • External References:
    • System.Windows.Forms.dll
  • Name Spaces:
    • System.Windows.Forms
    • System.IO
This action will copy the data to the clipboard. Now, you can write data from Clipboard in to a Data item using a Calc stage with expression 'GetClipboard()' . If you want to slice and dice the data in the Data Item, use related actions: Split lines, Split Text from String manipulations VBO.
On using these actions, the data will be written in to Collections. You can now write the data in collection to excel using 'Write Collection' action from MS Excel VBO.

Note: This line of code suggested works only for the notepad files.

Thank you...What if the data in the notepad is comma separated like
100000,2010-10-16 08:03:26,1078,1,3333,1
could you please suggest
 
Top