Write to file
Save a table as a CSV file or as a JSON list of records, replacing the file.
Command in the Data Table toolkit · id ooa.datatable/write_to_file · 10 inputs (1 required), 1 output
Inputs
| Input | Type | Required | Default | What it is |
|---|---|---|---|---|
| Table | Table | Yes | Table to save. | |
| Path | File | No | Target file, e.g. output/report.csv; a folder keeps the file there; a temporary file in the run's folder when empty (G2, AA's file variable). | |
| Format | String | No | csv | csv or json. |
| Delimiter | String | No | , | CSV delimiter (one character). |
| First row is the header | Boolean | No | true | Write the column names as the first CSV line. |
| Encoding | String | No | utf-8 | Text encoding, e.g. utf-8, utf-8-bom, ansi (windows-1252), utf-16. |
| Append | Boolean | No | false | Add the rows to the end of an existing CSV file (no header is repeated). |
| Line ending | String | No | crlf | Line ending of CSV rows. |
| Row delimiter | String | No | Text written after each CSV row instead of the line ending, e.g. | or ;\n (\n, \r and \t are understood). | |
| Create folders | Boolean | No | true | Create the file's folder when it does not exist; when off, a missing folder is an error. |
Outputs
| Output | Type | What it is |
|---|---|---|
| path | File | Full path of the written file. |