Read From File Action
<AMFILEREAD FILE="text" RESULTVARIABLE="text" MAXBYTES="number" BYTESVARIABLE="text">
Reads data from a file and places the data in a variable.
To read data from a text file. For example, a user may wish to read a list of names from a text file and use that data with the Send Keystrokes action to send the data to another action. To do this, start with the Read File Action to put all the data into a variable, then use the Loop List action to loop through the data, inside the loop use the Send Keystrokes action.
Specifies the file(s) to containing the data that should be read.
Specified the name of the variable to populate with the text contents of the file. The variable must have been created using a Create Variable <AMCREATEVAR> previous step.
Specified the name of the variable to populate with the number of bytes that were read from the file. The variable must have been created using a Create Variable <AMCREATEVAR> previous step.
The maximum number of bytes that should be read from the text file. This limit is important because it prevents AutoMate from taking up a virtually unlimited amount of system memory depending on the size of the file. Text beyond this amount of space is truncated.
This action includes the Description tab for entering a custom step description.
More on setting custom step description
This action also includes the standard Error Causes and On Error failure handling options/tabs.
More on Error Handling Options
All text fields allow the use of expressions, which can be entered by surrounding the expression in percentage signs (example: %MYVARIABLE%, %Left('Text',2)%). To help construct these expressions, you can open Expression Builder from these fields by pressing F2.
More on variables
More on expressions
More on the expression builder
NOTE: The code below can be copied and pasted directly into the Steps pane of the Task Builder.
<AMFILEREAD FILE="C:\foldername\names.txt" RESULTVARIABLE="datafromfile" MAXBYTES="100000" BYTESVARIABLE="amountread">