Using Write to file action

Use the Write to file action to write data from a table into file in .csv or .txt format.

Considerations while using the Write to file action:
  • Data extracted from a table is written as text into a file that is in .csv or .txt format.
  • Source table typically contains four types of values (string, number, date & boolean).

    All these values will work with the Write to file action.

  • Data containing decimals are not truncated unless there is 0 at the end.

    For example, if the source table has 87.90490, the data is extracted as 87.9049.

Procedure

  1. Double-click or drag Data table > Write to file.
  2. Click the Data table name drop-down menu and select the table variable that contains the data that you want to write to a file.
  3. Use the Enter file name field to specify the location of the file in which you want to write the data.
    You can also click the Browse button and select the file.
  4. Optional: Select the Create folders/files if it doesn't exist check box to create the file or folder that you specified in the Enter file name field.
    Consider an example where you have entered the filepath as C:\Sales\Invoices\July.txt in the Enter file name field. If you select the Create folders/files if it doesn't exist check box, Invoices folder and July.txt file are created at the time of the automation execution if they do not exist in the specified location.
  5. Use the When writing field to select one of the following options:
    • Append to the existing file: to write the extracted data at the end of the existing file.
    • Override existing file: to erase the existing content from the file and write data.
  6. Click the Row delimiter drop-down menu and select one of the delimiters for rows from the source table.
    A delimiter in Excel is a character or symbol that separates data in a row or column. For example, if a row contains a value like May, 2022, you can use comma as the delimiter to split the data into two rows.
  7. Click the Column delimiter drop-down menu and select one of the delimiters for columns from the source table.
  8. Optional: Click the Encoding drop-down menu to specify the encoding that you want to apply on the file.
    The default encoding is set to ANSI
  9. Click Save.