Skip to content
DonMartin76 edited this page Jul 24, 2015 · 2 revisions

Writing CSV files

Use the following target definition to write CSV files:

<Target config="[configuration]">file://[path to csv file]</Target>

Notes:

  • The file name must end with .csv, otherwise the CSV Writer will not react
  • The prefix must be file://; other location types are currently not supported.

Configuration of the CSV Writer

The config attribute may contain configuration settings of the CSV Reader using the following notation: parameter=value. The following parameters are supported:

Parameter Default Description
append false Pass true if you want to append to an existing file. This also means that the CSV Writer will not write any field headers (as they are assumed to exist)
delim ';' The delimiter used in the CSV file; normally ',' or ','.
encoding UTF-8 The encoding to use for the CSV file; supported values are any valid encoding, like UTF-8, UTF-16 or ISO-8859-1.
headers true Pass false to prevent the CSV Writer from writing the field headers. If not set, this is overridden by the append parameter (see above)
utf8bom true Determines whether the CSV Writer should output the UTF-8 Byte Order Mark or not. Only applies if encoding is UTF-8.

Example

<Target config="delim=';' encoding='iso-8859-1'">file://C:\Temp\my_output.csv</Target>

This outputs to the file C:\Temp\my_output.csv, using ; as a field delimiter, and using the encoding iso-8859-1 (Western European ANSI code page).

Escaping Rules

The same escaping rules as stated in the CSV Reader documentation are applied when writing CSV files. Please confer with the CSV Reader page for more information.

Clone this wiki locally