3 ms·
CSV files are simply lists of tuples. You can do lists of lists in JSON. Your overhead will be two characters (opening/closing braces) per tuple (one if you ski
by iso8859-1 14y ago
CSV files are simply lists of tuples. You can do lists of lists in JSON. Your overhead will be two characters (opening/closing braces) per tuple (one if you skip the newline, which you can't skip in CSV), plus a dozen characters for the whole file. I don't think that's a lot of overhead, seeing that you get the benefits of a format that is actually standardized.
Example (CSV):
name,age
James,32
Nina,10
Helga,90
JSON:
{"fields":["name","age"],
"content":[
["James",32],
["Nina",10],
["Helga",90]
]}
Don't tell me it's harder to parse, cause you'd have to do the index→fieldname conversion in CSV too.
- teyc 13y agoCSV isn't standardized. http://en.wikipedia.org/wiki/Comma-separated_values#Lack_of_a_standard http://en.wikipedia.org/wiki/Comma-separated_values#Lack_of_... There are a lot of questions regarding use of quotation, new lines etc. JSON's standard is that it should be able to be eval'd by javascript interpreter. Even then, date handling is less than ideal.