CSV to JSON V2
Learn how users can utilize CSV to JSON V2 in order to transform a CSV into a JSON object. The Documentation Portal provides configuration parameters of this component.
CSV to JSON V2 transforms a CSV into a JSON object.
Take a look at the configuration parameters of the component:
- CSV as File: if the option is enabled, the component waits for a file to generate the output JSON; otherwise, it is necessary to stop a CSV as array or string.
- Charset: if the CSV As File option is enabled, this field will be shown and the name of the characters code for the file reading (standard UTF-8) should be specified.
- File Name: when the CSV As File option is enabled, this field will be shown and it should get the name of the CSV file.
- CSV: when the CSV As File option is disabled, this field will be shown and a CSV in JSON format (array or string) must be provided.
- CSV Has Header: keep the option enabled if the CSV to be transformed has headers at the beginning of the array, string or file.
- Headers: list of CSV headers to be read - each CSV header will be converted to a JSON property. It is displayed only if the CSV Has Reader option is disabled.
- Delimiter: delimiter in which the CSV is configured.
- Fail On Error: if the option is enabled, the pipeline execution will be interrupted in case of an error. Otherwise, the pipeline execution proceeds, but the result will show a false value for the "success" property.
The component waits for a message with the property. You can provide the CSV data as an array of strings:
{
"data": ["HEADER1,HEADER2,HEADER3", "LINE1,LINE1,LINE1", ...]
}
as an unique string:
{
"data": "HEADER1,HEADER2,HEADER3\nLINE1,LINE1,LINE1\nLINE2,LINE2,LINE2"
}
or as a file:
File Name: arquivo.csv
{
"data": [{"HEADER1": "LINE1",
"HEADER2": "LINE1",
"HEADER3": "LINE1"
},
{"HEADER1": "LINE2",
"HEADER2": "LINE2",
"HEADER3": "LINE2"
}, ....]
}
If you receive an unique string:
{
"data": [{"HEADER1": "LINE1",
"HEADER2": "LINE1",
"HEADER3": "LINE1"
},
{"HEADER1": "LINE2",
"HEADER2": "LINE2",
"HEADER3": "LINE2"
}]
}
Last modified 2mo ago