JSONedit: CSV import
CSV import was introduced in JSONedit 0.9. Thanks to CSV import spreadsheet software can be used for effective array creation and editing. Spreadsheets offer plenty of content generation capabilities that would be pretty hard to reproduce in own software.
Most important CSV to JSON conversion limitation is lack of possibility to generate complex (nested) JSON structure.
JSONedit CSV reader follows pretty stricly RFC4180 recommendations:
- lines should be separated by CRLF (although JSONedit accepts also single LF),
- CRLF at the end of last line is optional,
- all lines must have the same number of fields,
- whitespaces inside fields are not ignored,
- double-quotes for fields are optional but required if field contains double-quotes CRLF or LF inside,
- double-quotes inside fields have to be escaped by doubling.
Conversion methods
There are three CSV to JSON conversion styles.
Source spreadsheet (Libre Office):
Row to object ("Properties") | Column to array ("Column array") | Row to array ("Row array") |
First row is treated as header. Each following row is transformed into object with elements named as header fields. | Each spreadsheet column is transformed into array of elements. Table is named after corresponding header row element. | Each row is transformed into separate array. If first first row is a header and should be ignored it can be easily deleted with tree editor. |