Support Portal

for ProcessRobot and WinAutomation

Start a new topic
Answered

Reading text file and varibles

Im new to this so please be gentle..

I have a text file that contains 5 simple lines,

 I want to read that file and place each line into a different variable.


I know this is simple but I cant get it thought it would be a loop process but that just gives me one variable


Best Answer

Hello John,


You can use the "Read Text from File" Action and in the Properties pane of the action, you can configure it so as to store each line as a different item in a list. 


Then you can just loop for each item. Please see the below images for more info:






Keep on automating!! ;) 


Use Read Text from File and change "Store file content as:" to List.


You can then use that list directly, or Set Variable afterwards: 

%Variable_1% = %FileContents[0]%

%Variable_2% = %FileContents[1]%

...

%Variable_5% = %FileContents[4]%

ADMIN
Answer

Hello John,


You can use the "Read Text from File" Action and in the Properties pane of the action, you can configure it so as to store each line as a different item in a list. 


Then you can just loop for each item. Please see the below images for more info:






Keep on automating!! ;) 

Login or Signup to post a comment