|
Read File Action |
Declaration |
<AMFILEREAD FILE="text" RESULTVARIABLE="text" MAXBYTES="number" BYTESVARIABLE="text"> |
See Also |
Copy File, Move File, Delete File, Delete Folder, Rename Folder |
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.
Standard Error Handling Options
This action also includes the standard "Error Causes" and
"On Error" failure handling options/tabs
More on Error Handling Options
Variables and Expressions
All text fields allow the use of expressions by surrounding the
expression in percentage signs (example: %MYVARIABLE%,
%Left('Text',2)%). To help construct these expressions, a popup
expression builder is available in all these fields by pressing F2.
More on variables...
More on expressions...
More on the expression builder...
<AMFILEREAD FILE="C:\foldername\names.txt" RESULTVARIABLE="datafromfile" MAXBYTES="100000" BYTESVARIABLE="amountread">