Write To File Action
<AMFILEWRITE FILE="text" DATA="text" APPEND="yes/no" BYTESVARIABLE="text">
Writes the data specified to a file. The data is either overwriting the file or is appened at the end of the file.
To write data to a text file.
Specifies the file(s) that the data should be written to.
Specifies whether the data should be appended to the end of the file as a new line or should overwrite all the data in the file. The available options are:
yes: The data will be appended onto the end of the file as a new line
no: The data will be overwritten
Specifies the data to write to the file. As with every text parameter, if the data you wish to write is contained in a variable simply type the variable name surrounded by percentage signs to resolve it to it's contents at runtime (e.g. %varname%).
Specified the name of the variable to populate with the number of bytes that were written to the file. The variable must have been created using a Create Variable <AMCREATEVAR> previous step.
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.
<AMFILEWRITE FILE="C:\test.txt" WRITEDATA="This is the text I want to write to the end of the file" VARIABLENAME="varname">