3 ms·
Indeed, this has already been done: http://ndjson.org/ http://ndjson.org/ To be fair it's not an objectionable format. Using line breaks to separate objects ma
by turtles_ 5y ago
Indeed, this has already been done: http://ndjson.org/ http://ndjson.org/
To be fair it's not an objectionable format. Using line breaks to separate objects makes it streamable, and you don't need to enclose the whole thing in an array to make it a valid JSON document.
- jerf 5y agoThat is not quite a CSV replacement. I use it for things with objects and stuff all the time. To be a CSV replacement you really need to add that each line must be a JSON array, and that it can only have scalars in it (no sub-arrays or objects). That would be a decent enough replacement for CSV itself. Not perfect, but the CSV "standard" is already a nightmare at the edge anyhow and honestly a lot of it can't be fixed anyway, so, this is probably as good as it could get.
- derefr 5y ago> that it can only have scalars in it (no sub-arrays or objects) I see CSV files that contain JSON arrays/objects in their fields all the time. Mainly from exporting Postgres tables that contain json/jsonb-typed columns. Are you saying that these aren't valid CSVs?
- zerocrates 5y agoThey're saying that a CSV equivalent should be strictly 2-dimensional, with "flat" values. Such a format could contain arbitrary JSON in a "cell", but simply as text, in the same way as putting the same data in a CSV.
- shaftoe 5y agoThese are strings containing JSON