Loop File Contents Action

Description

Loops through the contents of a 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.

Declaration

<AMLOOP TYPE="FILECONTENTS" FILE="Text" RESULTVARIABLE="Text" DELIMITER="Text">

Example

<AMLOOP TYPE="FILECONTENTS" FILE="C:\Temp\FileName.txt" RESULTVARIABLE="VariableName" DELIMITER="|">

General Tab Parameters

File: Specifies the file to loop.

Text, Required
MARKUP: FILE="C:\Temp\FileName.txt"

Populate variable with file data: Specifies an already created variable that should be populated with the next delimited string on each successive loop.

Text, Required
MARKUP: RESULTVARIABLE="varname"

Delimiter: Specifies the character that delimits the items in the file.

  • comma: The delimiter is a comma (e.g. item1,item2,item3).

  • new_line: The delimiter is a new line (default).

  • semi_colon: The delimiter is a semi colon (e.g. item1;item2;item3).

  • space: The delimiter is a space (e.g. item1 item2 item3).

  • tabulation: The delimiter is a tab character.

  • (custom): The delimiter is another character as specified (simply use the character).

Text, Optional - Default: new line
MARKUP: DELIMITER="comma"