CSV

See the following sections to parse CSV input or format CSV output.

Setting Stream Properties

You can set the following properties to parse the format of CSV input or to format CSV output. Select the necessary component and expand the Format property in the Stream pane.

Property name Value
Start Row Specify the line number of the first record. The default value is 1. If the first line of the data contains a header row, enter 2.
Number of Fields Specify the number of fields each record in the stream contains. The default value is 3.
Separator Select the delimiter that separates the fields. The default value is a comma.
<tab> Tab.
, Comma.
<space> Space.
; Semicolon.
| Vertical bar.
<none> None. Return each line as a field.
Quote Character Select the quote character the Flow Service uses to surround each CSV field. Note that you don't need to specify a quote character when you're reading a string from a CSV file.
If the quote character occurs in the text, the Flow Service escapes the quote character with the Quote Escape Character property.
The default value is a double quote: "
(none) No quote mark.
When a quote mark is not specified, single-byte spaces or tabs at both ends of the string field will be ignored.
" Double quote.
' Single quote.
Quote Target Select the target fields to quote.
All Quote all fields.
Only String Only quote string fields.
Quote Empty Fields Select whether to quote empty fields.
Yes Quote empty fields with empty quotation marks, which you define with the Quote Character property: "" or ''
No Don't add empty quotation marks to an empty field.
Quote Escape Character Specify the character to use to escape a quote character that appears in a string. The Flow Service puts the quote escape character in front of the quote character.
Backslash Escape with a backslash: \
Double Quote Escape with a double quote: "
Trim Whitespace Select whether to delete whitespace from the beginning and end of a string that is not enclosed in quotes.
This property is valid only when reading from a file. When a quoted string is being read, whitespace isn't trimmed regardless of the value specified here.
Yes Delete whitespace at the beginning and end of a string, unless the string is quoted.
No Don't delete whitespace at the beginning and end of a string.
Output Encoding Select the stream's encoding.
utf-8 Unicode UTF-8
shift_jis Shift JIS
euc-jp EUC-JP
iso-2022-jp ISO-2022-JP
utf-16 Unicode UTF-16
Windows-31J Windows-31J
Linefeed Select the linefeed that separates the records in the output CSV. This property is only valid when writing to a CSV file.
* When reading a stream from a file, the line feed code does not necessarily have to be the specified line feed code.
* When a string is output, if a line feed code exists in the output string, the line feed code specified here is output.
Platform Output the linefeeds to the standard linefeed code for the platform.
CR+LF Output the linefeeds as CR+LF.
CR Output the linefeeds as CR.
LF Output the linefeeds as LF.
Output Field Names Specify whether to output a header row, which contains the field names in the first line of the output stream.
No Don't output the field names in the first line.
Yes Output the field names in the first line, without quoting the field names.
Yes (Quote Field Names) Output the field names in the first line and quote the field names if a Quote Character is selected.

Defining Stream Fields

Define the name and data type to define a field in a CSV stream.

Field name Enter the field name.
Data type Select String, Boolean, Integer, Double, Decimal, or DateTime. (You can't specify binary.)

Validating Field Names

Note the conditions for a field name to be valid:

Note

  • Outputting null fields: When a component is reading a file and the data contains less fields than the field definition's field number, the missing fields are output as null fields. If the file contains more fields than the number of the stream's field definitions, the extra fields are ignored.

  • Escaping linefeeds: When a string field includes a linefeed and the Quote Character property is set to "none," the string returned is the part of the string up to the linefeed.

 

To the top of this page