CSV Parse
Description
Section titled “Description”This module reads a CSV file from the file system and converts it into an array of JSON objects. It supports custom configuration of column and row separators, file encoding and using the first row as header. It also automatically detects and parses JSON content embedded within CSV cells. It is ideal for importing data from CSV files generated by other systems, spreadsheets or database exports.
Configuration
Section titled “Configuration”Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
| filePath | string | Yes | Full path to the CSV file to read. Supports dynamic variables {{variable}}. |
| col_separator | string | No | Column separator. Default ,. |
| row_separator | string | No | Row separator. Values: line break (default), or any custom character. |
| codification | string | No | File encoding. Default utf8. |
| header_first_row | boolean | No | If true, uses the first row as column names. Default false. |
| col_header | string | No | Custom column titles. |
| dataKey | string | No | If specified, the result is wrapped in an object with this key. |
Output
Section titled “Output”{ "nextModule": "siguiente_modulo", "data": [ { "nombre": "Juan", "edad": "30", "ciudad": "Madrid" }, { "nombre": "Ana", "edad": "25", "ciudad": "Barcelona" } ], "_meta_": { "filename": "/ruta/al/archivo.csv", "rows": 2 }}Usage Example
Section titled “Usage Example”Basic case
Section titled “Basic case”{ "filePath": "/data/clientes.csv", "col_separator": ",", "header_first_row": true, "codification": "utf8"}- Supports dynamic variables
{{variable}}in thefilePathparameter - If
header_first_rowisfalse, columns are named ascol_1,col_2, etc. - Automatically detects and parses JSON objects embedded within cells
- Double quotes and carriage returns are automatically cleaned
- Empty lines are ignored during processing
Related Nodes
Section titled “Related Nodes”- csvcreate (inverse operation: JSON to CSV)
- dataTransform (transform data after import)
- dataMapping (map imported CSV fields)