i think JSONH [1] is a great replacement for csv. it's not as human-readable, but since no editors support elastic tabstops [2] by default, most csvs aren't readable anyhow.
It's possible to process a CSV file of unbounded size with a bounded amount of memory because you can just read it line-by-line. With JSON, you need to read the whole file into memory before you can get at the data.
{"field": "some\\ntext with new lines"}
{"field": "more text"}so rather than:
[2,"col_1","col_2","a","b","c","d"]
you can write: [2,"col_1","col_2",
"a","b",
"c","d"
]
and it will still be valid JSON/H and line-by-line parsed. or as 'burntsushi suggested, you can wrap each record in an array to pass through a normal json parser, though this wouldn't be JSONH any longer: [
["col_1","col_2"],
["a","b"],
["c","d"]
]It sounds like I'm being pedantic, but if you're not your sole producer and consumer of the data you'll inevitably have to deal with someone giving you valid JSON that isn't valid JSON`.