JSON to CSV
Export flat JSON records to CSV and test quoting and column order in the same example.
Export flat JSON records to CSV and test quoting and column order in the same example.
How to use
- Load the array of two records with id, name and note.
- Convert to CSV and open the result in a plain text editor.
- Read the header and compare both rows, paying attention to the embedded comma and quotes.
Worked example
Input
[{"id":"001","name":"林, Mei","note":"She said \"Hi\""},{"note":null,"id":"002","name":"Omar"}]Expected result
id,name,note
001,"林, Mei","She said ""Hi"""
002,Omar,Check the result
The header remains id,name,note, with an empty final cell in Omar’s row.