Write CSV
Write CSV
Section titled “Write CSV”Type: write-csv · Package: CSV Activities v1.0.0 · Output: string
Writes a DataTable to a CSV file. Useful for exporting data to a format that any system can import.
How it works
Section titled “How it works”Dump the dataTable to the path file using the indicated delimiter. By default it writes column names as header row (includeHeader = true). Returns the written path.
Required parameters
Section titled “Required parameters”| Parameter | Editor | Description |
|---|---|---|
path | expression | Path of the output CSV file. |
dataTable | expression | The DataTable to write. |
Optional parameters
Section titled “Optional parameters”| Parameter | Editor | Description |
|---|---|---|
delimiter | text | Separador de campos. Por defecto ",". |
includeHeader | boolean | Write the header row. By default true. |
encoding | text | Coding. By default "utf-8". |
Output
Section titled “Output”Returns a string with the file path written.
Example
Section titled “Example”DB Query sql = "SELECT * FROM Clientes" → output: clientesWrite CSV path = "C:/export/clientes.csv" dataTable = = clientes delimiter = ";"Related activities
Section titled “Related activities”- Read CSV — read a CSV.
- Write Excel Sheet — exportar a
.xlsx.