Skip to content

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.

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.

ParameterEditorDescription
pathexpressionPath of the output CSV file.
dataTableexpressionThe DataTable to write.
ParameterEditorDescription
delimitertextSeparador de campos. Por defecto ",".
includeHeaderbooleanWrite the header row. By default true.
encodingtextCoding. By default "utf-8".

Returns a string with the file path written.

DB Query sql = "SELECT * FROM Clientes" → output: clientes
Write CSV path = "C:/export/clientes.csv" dataTable = = clientes delimiter = ";"