Loops through the contents of the specified text file and populates a variable with the current string of delimited text. The loop ends at the end of the file or if a Break step is encountered. This action wraps the functionality of a Read from File action and a Loop List action into one concise loop structure. Used to perform one or more actions on each item in a delimited text file.
Declaration
<AMLOOP TYPE="FILECONTENTS" FILE="text" RESULTVARIABLE="text" DELIMITER="text(options)">
See Also: Loop, End Loop, Loop Array, Loop Files, Loop Windows, Loop Expression, Loop Dataset, Loop List, Loop List Control, Loop Tree Control
To set Loop File Contents properties
In the Available Actions pane, open the Loop folder and double-click the Loop File Contents action or drag it into the Steps pane.
In the File box, click Open Folder and navigate to the file.
In the Populate variable with file data box, select the variable to populate.
In the Delimiter box, select the delimiter. If you select Custom, enter the delimiter in the Custom delimiter text box.
To set the Description tab properties, refer to Description Tab Options.
To set the Error Causes and On Error tab properties, refer to Step Error Handling.
When finished, click OK to save settings and close the properties dialog box.
To auto-indent after all steps are added
In the Steps pane, hold down SHIFT and click the first and last steps in the block so that the complete block of steps is selected.
Click Format .
Property |
Type |
Required |
Default |
Markup |
Description |
File |
Text |
Yes |
While |
FILE="C:\Temp\FileName.txt" |
The file that contains the text to loop through. |
Populate Variable with file data |
Text |
Yes |
(Empty) |
RESULTVARIABLE="varname" |
The name of the variable that should be populated with the next delimited string on each successive loop. |
Delimiter |
Text (options) |
No |
New Line |
DELIMITER="comma" |
The character that delimits the text in the file. The available options are:
|