Write CSV File

Operation name

Write CSV File

Function overview

Writes input data to a file of format such as CSV (Comma Separated Values), TSV (Tab Separated Values), etc.

Data model

The data model of this component is table model type.

Properties

= Remarks =

For details on use of variables, refer to Variables.

Basic settings

Item name

Required/Optional

Use of variables

Description

Remarks

Name

Required

Not available

Enter a name that is used on the script canvas.

 

Input data

Required

Not available

Select a component on the script canvas.

 

Required settings

Item name

Required/Optional

Use of variables

Description

Remarks

File

Required

Available

Enter the file path of CSV or TSV format.

The Browse button launches a file chooser that allows you to select a file.

Note

Delimiter mode

Required

Not available

Select a method to specify delimiter.

Select from list

(Default)

Select a delimiter character from the list.

Enter directly

Enter the delimiter character directly in the field.

Enter character code

Enter the delimiter character using character code in the field.

  • Depending on selected method, the corresponding input field is displayed.

Select from list/Delimiter

Optional

Not available

Select a delimiter character.

Comma

(Default)

A comma (,) is specified.

Tab

A tab is specified.

Space

A space ( ) is specified.

Semicolon

A semicolon (;) is specified.

Slash

A slash (/) is specified.

Vertical bar

A vertical bar (|) is specified.

  • Enabled when Select from list is selected in Delimiter mode.

Enter directly/Delimiter

Optional

Available

Enter one character for delimiter.

  • Enabled when Enter directly is selected in Delimiter mode.

  • Double quotation can't be specified as a delimiter character.

Enter character code/Delimiter

Optional

Available

Enter the character code.

The character code is converted with the encoding specified in Encoding.

You can enter the code as octal (with prefix "0" <number zero>), decimal (without prefix), and hexadecimal (with prefix "0x" <alphabet x with number zero> or "#").

If the delimiter character is a multi-byte string, enter it separated with a comma. Example: 0x10,0x13

  • Enabled when Enter character code is selected in Delimiter mode.

  • A character code that is converted to one character can be entered.

  • A character code that is converted to newline code or double quotation can't be specified.

  • When using a multi-byte string, don't enter spaces before and after the comma.

Column list

Optional

-

Each column can be operated with the following buttons:

Up

Moves the selected column upward by one row.

Down

Moves the selected column downward by one row.

Add

Adds a column.

Delete

Deletes the column.

  • Data will be written only for the number of columns set in Column list.

  • Column names set in Column list will be displayed in Mapper schema.

Column list/Column name

Required

Available

Enter the column name.

The first row of the file specified in File can be set as a column name using Update column list property action.

 

Column list/Quotation

Optional

Not available

Select whether or not to enclose each column with double quotations.

Selected

Enclose each column with double quotations.

Not selected

(Default)

Don't enclose each column with double quotations.

 

Property actions

Item name

Description

Remarks

Preview

The previewer is started, and the contents of the file specified in File is displayed.

  • Disabled when the specified file doesn't exist or a variable is set in File.

  • The contents are displayed with the encoding specified in Preview Character Set.

  • The contents of the file can't be edited.

  • The maximum file size that can be displayed in the previewer is 1MB. If the file size exceeds 1MB, the contents up to 1MB from the beginning of the file will be displayed.

Update column list

The first row of the file specified in File is set as a column name.

  • Disabled when the specified file doesn't exist or a variable is set in File.

Read column names from first row of file

Select a file in file chooser, and the first row of that file is set as a column name.

 

Read the number of columns from file

Select a file in file chooser, and the number of columns of that file is set as the number of column names.

 

Write settings

Item name

Required/Optional

Use of variables

Description

Remarks

Encoding

Required

Available

Select or enter an encoding for the file to write.

When you enter encoding, specify one of the encodings supported in Java SE Runtime Environment 8.

  • For details, refer to "Supported Encodings" (http://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html).

  • The default encoding selected for Encoding of file type connectors is UTF-8.

Newline code

Required

Not available

Select a newline code.

CR
LF
CR+LF

(Default)

  • If you used the CSV connector on or before February 26, 2023 with AUTO specified, the processing is performed with LF set.

    When you update the script, specify LF.

Overwrite

Optional

Not available

Select whether or not to overwrite when the specified file exists.

Selected

(Default)

Overwrite.

Not selected

Don't overwrite. When the file already exists, an error occurs.

 

Append

Optional

Not available

Select whether to append data to the end of the file or to overwrite the file if the specified file exists.

Selected

Append to the end of the file.

Not selected

(Default)

Overwrite.

  • Enabled only when Overwrite is selected.

Insert column names into first row

Optional

Not available

Select whether or not to insert column names into the first row of the specified file.

Selected

Insert Column name of Column list into the first row.

Not selected

(Default)

Don't insert column names.

Note

Column names will be inserted not into the first row of the file to be written to, but into the first row of the result data.

Do not insert column names when the file exists

Optional

Not available

Select whether or not to insert column names into the first row of the result data when the specified file exists.

Selected

Don't insert column names into the first row of the result data when the specified file exists.

Not selected

(Default)

Insert column names into the first row of the result data.

  • Enabled when Insert column names into first row is selected.

Transaction

Item name

Required/Optional

Use of variables

Description

Remarks

Execute transaction processing

Required

Not available

Select whether or not to execute transaction processing.

Selected

Transaction processing will be executed.

Not selected

(Default)

Transaction processing won't be executed.

For details, refer to Transactions for the connectors in the File category.

 

Comment

Item name

Required/Optional

Use of variables

Description

Remarks

Comment

Required

Not available

You can write a short description of this connector.

 

Schemas

Input schema

The number of columns varies depending on the Column list settings.

= Remarks =

For schema structure, refer to Table model type .

Output schema

None.

Loading schema in Mapper

The schema is loaded automatically.

= Remarks =

For details, refer to Edit Schema.

Transaction

Transaction is supported.

 

Transaction is enabled only when Execute transaction processing of Transaction is selected.

Parallel Stream Processing

PSP is supported.

= Remarks =

For details on PSP, refer to Parallel Stream Processing.

Available component variables

Component variable name

Description

Remarks

count

The number of written data records is stored.

  • The default value is null.

message_category

When an error occurs, the category of the message code corresponding to the error is stored.

  • The default value is null.

message_code

When an error occurs, the code of the message code corresponding to the error is stored.

  • The default value is null.

message_level

When an error occurs, the severity of the message code corresponding to the error is stored.

  • The default value is null.

error_type

When an error occurs, the error type is stored.

  • The default value is null.

  • The format of the error type is as follows.

    Example: java.io.FileNotFoundException

error_message

When an error occurs, the error message is stored.

  • The default value is null.

error_trace

When an error occurs, the trace information for the error is stored.

  • The default value is null.

Message codes, exception messages, and limitations

Connector

Message code

Exception message

Limitations

Messages and limitations of the CSV connector

check

check

check