The Write to File action is used to write data to a selected file. The data can be typed into the properties dialog box, or taken from a variable. You can write to an existing file or have the step create a new file along with any additional folder structure you want to add. When writing to an existing file, the step can either overwrite the file or append to it.
Variables used must be created in earlier steps using the Create Variable action.
From the Task Builder Available Actions pane, open the File folder and double-click the Write to File action or drag it into the Steps pane.
In the File box, enter the path and file name, or click the Open Folder button and navigate to the file. You can use an existing file or enter a new file name and any new folder structure you want to add. The file and folders will be created at runtime.
Under Method, select Overwrite file or Append at the end of the file. By default the data is appended.
In the Data to write box, type the data to be written, or, if you want to use data from a variable, enter the variable name between percent signs (%VariableName%). Also, you can click the Insert Expression/Variable button and use the Expression Builder to enter a variable.
If you want to record the number of bytes written, click the Advanced tab and select the variable to populate.
To set the Description tab properties, refer to Description Tab Options.
To set the Error Causes and On Error tab properties, refer to Step Error Handling.
When finished, click OK to save settings and close the properties dialog window.
Adding Task Steps
Write to File Action