Get Text From a File Line by Line

Read from and loop through each line of a text file, retrieve the data and display in a message dialog

Get text from a file line by line

This task will read from and loop through each line of a text file, retrieve the data and display it in a message dialog. 

Two variables are created, "myfile" and "myfile2". The variable named "myfile" is used with the "Read from File" action. The "Read from File" action populates this variable with the contents of the text file. The "myfile2" is used in the "Loop List" action to loop through the data that the myfile variable contains. The message dialog within the loop will display each line of text. 

Please note that the comma delimiter, in the "Delimiter" field of the "Loop List" action is selected by default. In this task it has been changed to "New line." Change this parameter depending on the type of text document you are retrieving data from. The choices are as follows:

Space, Semi-Colon, Tabulation, Space, Semi-Colon, and Custom

Make sure the attached text file is copied to the root of your C:\ drive or change the path to the file in the "Read from File" step.

Task Category:

Functions (Basic)