In this preprocessing step it is possible to convert CSV file data into JSON format. It's supported in:
To configure a CSV to JSON preprocessing step:
The first parameter allows to set a custom delimiter. Note that if the first line of CSV input starts with "Sep=" and is followed by a single UTF-8 character then that character will be used as the delimiter in case the first parameter is not set. If the first parameter is not set and a delimiter is not retrieved from the "Sep=" line, then a comma is used as a separator.
The second optional parameter allows to set a quotation symbol.
If the With header row checkbox is marked, the header line values will be interpreted as column names (see Header processing for more information).
If the Custom on fail checkbox is marked, the item will not become unsupported in case of a failed preprocessing step. Additionally, custom error handling options may be set: discard the value, set a specified value or set a specified error message.
The CSV file header line can be processed in two different ways:
CSV file example:
Nr,Item name,Key,Qty
1,active agent item,agent.hostname,33
"2","passive agent item","agent.version","44"
3,"active,passive agent items",agent.ping,55
A quotation character within a quoted field in the input must be escaped by preceding it with another quotation character.
Processing header line
JSON output when a header line is expected:
[
{
"Nr":"1",
"Item name":"active agent item",
"Key":"agent.hostname",
"Qty":"33"
},
{
"Nr":"2",
"Item name":"passive agent item",
"Key":"agent.version",
"Qty":"44"
},
{
"Nr":"3",
"Item name":"active,passive agent items",
"Key":"agent.ping",
"Qty":"55"
}
]
No header line processing
JSON output when a header line is not expected: