4 ms·
>CSV is superior to JSON for tabular data Can't you just do this? { "columns": ["col1", "col2", "col3"], "data": [ [1, 2, 3
by _dain_ 4y ago
>CSV is superior to JSON for tabular data
Can't you just do this?
{
"columns": ["col1", "col2", "col3"],
"data": [
[1, 2, 3],
[4, 5, 6],
[7, 8, 9]
]
}
That's valid JSON but it's human-readable and human-editable rows of comma-separated data, just like CSV.
- hermitcrab 4y agoYou can. But I don't see how that is superior to the equivalent CSV.
- foul 4y agoUntil you try to either cram it into Excel, work with different encodings or pass it around different software platforms (even your lang vs JS), no difference. CSV has been abused a lot to make it work on conflicting use-cases, JSON handles a lot of misshaps happened with delimiter-separated record formats, like new-lines or bring-your-own-character encoding.