CSV Writer

This Node Is Deprecated — This version of the node has been replaced with a new and improved version. The old version is kept for backwards-compatibility, but for all new workflows we suggest to use the version linked below.
Go to Suggested ReplacementCSV Writer

This node writes out the input data table into a file or to a remote location denoted by an URL. The node provides many options to customize the output format (see below). But there is no checking done on the settings, so it is possible to write out the data in a format that makes it impossible to read it in again (e. g. if you specify no data separator).
Note that if the destination location is a remote URL not all options are available because in general it's not possible to determine whether the remote location exists. In this case it will always be overwritten.

Options

Settings

General settings regarding the output file location and formats.

Output location
Enter a valid file name or URL. You can also choose a previously selected location from the drop-down list, or select a local file from the "Browse..." dialog.
Write column header
If checked, the column names will be written out in the first line of the output file.
Don't write column headers if file exists
If checked, the column headers will not be written when the output is appended to the already existing output file. This is particularly useful when the CSV Writer is used in a loop to report results. This option is ignored when the column header is not written anyway or the file append option is unchecked (see below).
Write row ID
If checked, the row IDs will be added to the output, as first item in each line.
Compress output file (gzip)
Compress the output file in gzip format. If enabled, you will not be able to append to an existing file.
If file exists...
Specify the behavior of the node in case the output file already exists. Overwrite will replace any existing file, Append will append the input table to the end of the file (possibly skipping the column header) and Abort will issue an error during the node's execution (to prevent unintentional overwrite).

Advanced

In the Advanced tab, you can specify the character(s) that will be written out between the data items.

Data Separator
You can use "\t" for a tab or "\n" for a new line character (and must use "\\" for a backslash) in any character sequence.
Missing Value Pattern
In the Advanced tab, enter a pattern that will be written out for missing data values. Note, the missing value pattern will never be put into quotes (see below).
Line Ending
In the tab "Advanced" you can select the line endings that are written to the file. Default value is the system default value, which is system dependent (LF on Linux/Unix systems, CR+LF on Windows systems). You can enforce a certain line ending to generate a file that is readable on a different operating system.

Quotes

In the Quotes tab, you can enter a left and right quotation mark pattern. Also, select a mode, which determines when quotation marks should be placed around the data item. When quotes are used (in every mode other than "never") you must also specify a replacement pattern for the right quote. If it appears in the data item, it must be replaced (so it won't be confused with the actual closing quote).

Quote Mode: always
Every data item written out is placed between quotation marks. (The missing value pattern is not quoted though.)
Quote Mode: if needed
Quotes are only placed around a data item that contains the data separator (specified in the Advanced tab) or if it equals the missing value pattern. The right quote pattern will be replaced if it appears in a quoted data item.
Quote Mode: non-numerical only
Integer and floating point numbers are not quoted, all other data items are. (Selecting the decimal point as data separator will lead to an output that can't be read in again.) The right quote is replaced in quoted items.
Quote Mode: never
No data item is placed between quotation marks. You should specify a replacement pattern for the data separator, if it occurs in the data item.

Comment Header

In the Comment Header tab you can add a comment header to the beginning of the output. Either specify your own comment line(s) or choose from the predefined items. If you check one of the options you must also enter a comment begin and comment end pattern.

Header Content: the current creation time
If checked, a comment line with the current time and date is added.
Header Content: the user account name
If checked, the login name of the user that created the file (probably you!) is inserted.
Header Content: the input table name
If checked, a comment line is added showing the name of the table the data was read from.
Header Content: this text
If you check this, you can enter any text, that will be added then to the comment header. Use "\n" to start a new line, and "\t" to insert a tab character (and "\\" to produce a backslash).
Comment Pattern
If you have checked at least one of the content options, you must provide comment begin and end patterns that are placed around the comment header then. If you omit the end pattern the begin pattern is placed at the beginning of each comment line (assuming single line comments, in contrast to block comment if you specify both patterns).
Comment Indentation
If you have checked at least one of the content options, you can specify an indentation string, i.e., a prefix for every comment line.

Number Format

In the tab "Number Format" you can define the decimal separator and whether scientific notation should be used.

Decimal Separator
Here you can enter a character that is used as decimal separator for floating point numbers. It replaces the default character '.' then.
Scientific Notation
Check this if you want very large and very small floating point numbers to be written in scientific notation (e.g., 1.0E9 instead of 1,000,000,000).

Encoding

File Encoding
To write a csv file with a different encoding, you can select a character set in this tab (UTF-8, UTF-16, etc.), or specify any other encoding supported by your Java VM. The default value uses the default encoding of the Java VM, which may depend on the locale or the Java property "file.encoding"

Input Ports

Icon
The data table to write out.

Output Ports

This node has no output ports

Popular Successors

Views

This node has no views

Workflows

Links

Developers

You want to see the source code for this node? Click the following button and we’ll use our super-powers to find it for you.