Text File Process
The Text File Process command reads each line of a text file into a variable. The entire line of text is saved into a single variable.
Script Editor > Expand Files or Folders Category > Text File Process
Each line of the text file is loaded into a variable which can be used later in the macro. Select which line of the text file to begin with and either process all the lines from that point or just process a specific number of lines. Use of the variable and processing take place between the command to open the text file and the command to end the text file processing.
❖Cautionary Note: Do not manually edit or have another program edit the file during the processing, as this may cause unpredictable results on the computer. If you need to edit or update the file while the Text File Begin Process command is running, then have the macro make a copy of the file and process the file copy.
If a text file contains the following data:
FMC,"98 SE, 2000",,Talon,750 MHz,256 B,,83
H,95 B,5.00.3314.2101,P II,333 MHz,65 B
H,"98 SE, 2000",5.00.3314.2101,P III,550 MHz,384 B,,,"17"" Flat"
and variable T is used as the "Variable to Receive First Field".
The first time through the Process loop the variables will be:
T = FMC,"98 SE, 2000",,Talon,750 MHz,256 B,,83
The second time through the Process loop the variables will be:
T = H,95 B,5.00.3314.2101,P II,333 MHz,65 B
The third time through the Process loop the variables will be:
T = H,"98 SE, 2000",5.00.3314.2101,P III,550 MHz,384 B,,,"17"" Flat"
Insert the name of the text file to be opened and processed. Click on the Browse button to locate the file and path or enter manually.
Variable to Receive Result
This is the text variable that receives the value of the text line in the file. This variable may then be used and processed by other macro commands.
Begin Processing on Record ___
Use this option to select which record to begin processing in the file. To process the entire file, enter 1 in the value field to indicate starting with the first record. Or use an Integer variable when specifying which record to start processing and the number of records to process.
What to Process
Process All Records
Select this option to process every record in the file, if electing to start with record #1. Or it will start with the record selected and process all subsequent records.
Process Partial Records
Choose the "Process Partial Records if only needing to process a certain range of records (or lines of text).
Number of Records to Process
Enter in this field the number of records to process.
Text File End Process
Each Text File Begin Process command requires a corresponding Text File End Process command. All commands in the script between the Begin and the End Process commands will be repeated the number of times instructed.
üNote: If all records have been read out of the text file and processed, then control goes to the macro command that immediately follows the Text File End Process command.