ePrivacy and GPDR Cookie Consent by Cookie Consent

Processor Json to CSV

Data In/ Data Out

JSON to CSV processor is a CSV auto flattening processor.

Data In

The processor takes all CSV files from /data/in/tables/

Data Out

All flattened CSV files to /data/out/tables/ directory

Input files need to fit the following format:

  • Multiple columns are allowed,
  • If a cell contains a scalar value (int, float, text, bool),  it will be copied into output file 1:1,
  • If the cell contains stringified  JSON object (dictionary), it is flattened appropriately.

If the cell contains stringified JSON object (array), another table with parent_id is created in output files (component might create several output files, it depends on JSON data structure in the input file).

Example of input file:

 

Directory: /data/in/tables/foo.csv

Screenshot 2021-11-15 at 4.17.01 PM.png

 

Column1 = 42 (scalar value, this will be copied into output file as it is)

 

Column2 = JSON object (dictionary). This will be flattened appropriately in the output file.

 

Column3 = JSON object (array). Another table with parent_id is created in output files.

 

Output files:

 

2 files in /data/out/tables/ directory 

  1.  foo.csv
  2. foo_{{column_name}}.csv

Screenshot 2021-11-15 at 4.19.59 PM.png

 

Content of foo.csv output file:

 

Screenshot 2021-11-15 at 4.21.57 PM.png

 

 

Content of foo_column3.csv output file:

 

Screenshot 2021-11-15 at 4.22.50 PM.png