CSV adapter module

The CSV adapter module contains the following processes:

Write process

The Write process writes rows to a specified CSV file. If a file already exists, the Write process overwrites the rows in the file, without any indication.

The following table describes the process inputs for the CSV adapter with the Write process.

CSV adapter Write process inputs 

Input

Description

Required

<adapter name>

Specifies the name of the adapter to use for this process 

Default value: CSVAdapter

No

<file-name>Specifies the absolute path and the file name of the file, in which you want the adapter to add dataYes
<delimiter>

Specifies a character that is used to indicate the end of one field and the beginning of the next

Default value: (,)

No
<text-qualifier>

Specifies a character that differentiates field data from a delimiter

Each field's data is between the text qualifier.

For example, the field data contains a comma and a comma is used as a record delimiter, then text qualifier must be used to distinguish between the comma’s in the data and the comma’s used to delimit fields.

Default value: (")

No

<preserve-spaces>

Specifies whether to preserve spaces between the rows in a CSV file

Valid value: true, false (default)

No
<charset>Specifies the supporting CharSet 

Also called character set, it includes identifiers describing a series of universal characters.
No
<rows>

Specifies a row to be added to the CSV file

Contains the columns element.

Yes

The following table describes the process output parameter for the CSV adapter with the Write process.

Write process output 

Process output

Description

adapter response

Specifies the CSV adapter's response

The following table lists the sample delimiter formats.

Sample delimiter formats 

Delimiter

Format

tab

\t

pipe\ |

asterisk

\ *

dash

\ -

comma

, OR \,

semi colon

; OR \;

underscore

_ OR \_

dollar sign

\$

double quotation marks

&quot;

Read process

The Read process reads the data in the CSV file. The following table describes the process inputs for the CSV adapter with a Read action.

CSV adapter Read process inputs

InputDescriptionRequired

<adapter name>

Specifies the name of the adapter to use for this process 

Default value: CSVAdapter

No

<file-name>Specifies the absolute path and the file name of the file, which you want the adapter to readYes
<delimiter>

Specifies a character that is used to indicate the end of one field and the beginning of the next

Default value: (,)

No
<text-qualifier>

Specifies a character that differentiates field data from a delimiter

Each field's data is between the text qualifier.

For example, the field data contains a comma and a comma is used as a record delimiter, then text qualifier must be used to distinguish between the comma’s in the data and the comma’s used to delimit fields.

Default value: (")

No
<read-headers>

Specifies whether to read the first row in the data as column headers

Valid values: true, false (default)

No
<start-index>

Specifies the row from where the adapter starts reading the rows in the CSV file

Default value: 0

If the <start-index> is 0, all rows in the CSV file are read.

No
<maximum rows>

Specifies the number of rows to be read from the CSV file starting from start index

For example: if the <start-index> is 5 and <maximum-rows> is 10, in the CSV file, rows 5 to 15 are read.

Default value: 0

No
<charset>Specifies the supporting CharSet 

Also called character set, it includes identifiers describing a series of universal characters.
No

The following table describes the process output parameter for the CSV adapter with the Read process.

CSV adapter read process output 

Output

Description

adapter response

Specifies the CSV adapter's response 

The format varies based on the inputs provided.

Delete process

The Delete process deletes a specified file. The following table describes the process inputs for the File adapter with the Delete process.

CSV adapter Delete process inputs 

Input

Description

Required
<file-name>Specifies the name and location of the file in which you want to delete specified rowsYes
<delimiter>

Specifies a character that is used to indicate the end of one field and the beginning of the next

Default value: ,

No
<text-qualifier>

Specifies a character that differentiates field data from a delimiter

Each field's data is between the text qualifier.

For example, the field data contains a comma and a comma is used as a record delimiter, then text qualifier must be used to distinguish between the comma’s in the data and the comma’s used to delimit fields.

Default value: (")

No
<read-headers>

Specifies whether to read the first row in the data as column headers

Valid values: true, false (default)

No
<charset>Specifies the supporting CharSet 

Also called character set, it includes identifiers describing a series of universal characters.
No
<start-index>

Specifies the row from where you can start deleting the rows in the CSV file

Default value: 0

If the <start-index> is 0, none of the rows are deleted from the CSV file.

No
<maximum rows>

Specifies the number of rows to be deleted from the CSV file starting from start index

Default Value: 0 (No rows are deleted)

For example: if the <start-index> is 5 and <maximum-rows> is 10, in the CSV file, rows 5 to 15 are deleted.

No

The following table describes the process output parameter for the File adapter with the Delete process.

Delete process output 

Output

Description

adapter response

Specifies the CSV adapter's response

Was this page helpful? Yes No Submitting... Thank you

Comments

  1. James Annis

    While I understand that the output for these commands can vary depending on the inputs, you really need to include the output for the common customer use cases.

    1. Basic output assuming all the default values for the required parameters.
    2.  For READ/DELETE show the output when <file-name> does not exist.
    3. For WRITE show the output when <file-name> exists, and describe the behavior (existing file is replaced, specified rows are appended, operation is aborted with an error, etc.)
    4. For READ/DELETE where the <start-index> value is greater than the number of lines in the file.
    Apr 25, 2014 09:17
    1. Shweta Hardikar

      Working on incorporating samples in the documentation.

      May 05, 2014 12:10
      1. James Annis

        Any updates?

        Jun 30, 2014 11:35
        1. Shweta Hardikar

          Hi Jim,

          We have added a story to work on updating the samples in the next content release approximately planned for Q3. 

          Aug 13, 2014 11:17