Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

In this article

Table of Contents
maxLevel2
excludeOlder Versions|Additional Resources|Related Links|Related Information

...

Field Name

Field Type

Description

Label*

Default ValueCSV Formatter
ExampleCSV_Formatter_temp

String

Specify a unique name for the Snap.

Binary header properties

Use this fieldset to add binary-header properties to the output data. These properties contain data related information that enables the system to interpret data.

Binary headers in a document can be accessed and used in the expression-enabled properties of downstream Snaps. For example, you can use binary headers to specify custom statuses associated with the output data.

Similarly, a 'content-location' property added to the binary header in this Snap can be referenced in the File name property of a File Writer Snap with the expression: $['content-location'].

Expression

Default valueN/A
Exampletext/csv

String

Specify the value to be associated with a specific binary header property.

Field 2

Default ValueN/A
Example$['content-location']

String

Specify the target JSON path where the value in the expression is written.

Quote character

Default value:  “
Example:  “

String

The character that you want to use as the escape character in the CSV document. For example, if you use double quotes (") as the escape character, then commas in the actual data will need to be escaped using double-quotes on both sides.

This property can be an expression. However, if the value associated with the expression contains more than one character, only the first character is used as the quote character.

Quote mode

Default value:  ALL
ExampleMINIMAL

Dropdown list

Select an option to specify how the quote character should be used in formatting the CSV data. Available options are:

  • ALLAll values are quoted.

  • MINIMAL: Values are minimally quoted.  For example, if a value includes a delimiter character, only that character is enclosed in the quote character.

  • NON_NUMERIC: All values except numbers are quoted. If values in the input documents are number objects, they are not quoted. If they are numeric strings, they are quoted.

  • NONE: No value is quoted. If a value includes a delimiter character, it is escaped with a '\' (backslash).

If the Quote character property is empty, the selection of this property is ignored and the Snap uses NONE for the Quote mode.

Delimiter

Default value:   ,
Example\t, \u0001

String/Expression

Specify the string or the character that must be used as a delimiter in formatting the CSV data. Tabs are common delimiters. To use a tab as the delimiter, enter \t.

  • This field accepts any delimiter that can be a single character or a string. For example, \t resolves to a tab. You can also use strings, such as |,|, abc*abc, or !*!.

  • You can use an escaped Unicode string, such as \u0007, \u0021\u0022\u0021, or \u0021\t.

Note

When you use the backslash (\) as a delimiter, use an additional backslash (\\) for the Snap to escape it. For a multi-character delimiter with a backslash, you must enter the additional backslash. However, when the delimiter contains a single backslash, the additional backslash is optional.

Use header

Default valueDeselected
ExampleSelected

Checkbox

Select this checkbox to indicate whether the column names in the Header fields property should be used to format the CSV data. If this checkbox is deselected, the key set of the first document data is used as a CSV header.

Note

Ensure that the CSV document header contains non-empty values for all columns.

Header fields

Default valueN/A
Example$name

String

Specify the header values that you want to use in the output CSV data.

Write CSV header

Default valueSelected
ExampleDeselected

Checkbox

Select this checkbox to indicate whether the header strings listed in the Header fields properties should be written to the output CSV data.

Default value: Selected.

Header size error policy

Default valueDefault
ExampleFail if record is larger than header

Dropdown list

Select an option to handle any header size errors. 

  • If the Use header field is not selected, then the Snap determines the CSV header from the key set of the first input document.

  • If the Write CSV header field is selected, then the Snap writes the CSV header to the output view binary stream.

The header size error condition occurs when any subsequent input document has additional column names which are not present in the header. To handle header size errors, you can select any of the following options:

  • Default: The Snap appends the additional values to the CSV line.

  • Trim record to fit header: The Snap writes the trimmed CSV line to the output view and ignores all additional values in the input document.

  • Fail if record is larger than header: The Snap writes the error document to the error view and continues to process the next input document. 

Ignore empty stream

Default valueDeselected
ExampleSelected

Checkbox

Select this checkbox to indicate whether you want the Snap to ignore empty streams received at the input view during Pipeline execution. If this option is selected, the Snap does not produce any output stream; else, the Snap writes an empty array to the output stream.

Character set

Default valueUFT-8
ExampleUTF-16LE

Dropdown list

Select the character set in which the input CSV data is encoded. The available options are:

  • UTF-8

  • UTF-16LE

  • UTF-16BE

Write BOM

Default valueDeselected
ExampleSelected

Checkbox

Select this checkbox to indicate the behavior of the Snap when it starts to write the CSV output data. If this option is selected, the Snap writes the BOM (Byte Order Mark) for the character set selected in the Character-set encoding property; else, the Snap skips writing BOM.

Newline

Default valueLF
ExampleCR+LF

Dropdown list

Select an option to specify the newline characters that you want to use as a line break. The available options are: LF, CR+LF and CR.

Escape character

Default value\
Example\

String

Specify the escape character that is to be used when formatting rows. Only single characters are supported. As of 4.3.2, this property can be an expression, which is evaluated with the values from the pipeline parameters.

Leave this property empty if no escape character is used in the input CSV data.

Snap Execution

Default ValueValidate & Execute
Example: Disabled

Dropdown list

Select one of the three modes in which the Snap executes. Available options are:

  • Validate & Execute: Performs limited execution of the Snap, and generates a data preview during Pipeline validation. Subsequently, performs full execution of the Snap (unlimited records) during Pipeline runtime.

  • Execute only: Performs full execution of the Snap during Pipeline execution without generating preview data.

  • Disabled: Disables the Snap and all Snaps that are downstream from it.

...