2 ms·
A format consisting of newline-terminated records, each containing comma-separated JSON strings would be superior to CSV. It could use backslash escapes to den
by kazinator 2y ago
A format consisting of newline-terminated records, each containing comma-separated JSON strings would be superior to CSV.
It could use backslash escapes to denote control characters and Unicode points.
Everyone would agree exactly on what the format is, in contrast to the zoo of CSV variants.
It wouldn't have pitfalls in it, like spaces that defeat quotes
RFC CSV JSON strings
a,"b c" "a", "b c"
a, "b c" "a", " \" b c\""
oops; add an innocuous-looking space, and the quotes are now literal.
- deleted 2y ago[deleted]
- kazinator 2y ago"Any JSON primitive" does add a few requirements not semantically comparable to CSV, like numbers that are numbers, and keywords true, false, none. When these syntaxes are parsed into objects, either the type info has to be retaind, or some kind of attribute tag, so they can be output back to the same form. > make it so any consumer can parse it by splitting on newline and then ... There is something like that called JSON-lines. It has a .org domain 'n' everything: https://jsonlines.org/ https://jsonlines.org/