Why naive JSON-to-CSV exports break: escaping, BOMs and line endings
A simple JSON-to-CSV converter can fail badly once a field contains a comma, double quote, or newline, because the remaining columns shift out of place. The fix is to wrap such values in double quotes and double any quotes inside them, quoting only when necessary. Joining raw values with commas works on sample data but corrupts real records, and a leading byte-order mark helps Excel display non-ASCII text correctly. The article also recommends CRLF record separators and flattening nested objects one level with dot notation, with deeper structures better placed on a second sheet. The converter it describes runs entirely in the browser, so no data is uploaded.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in