3 ms·
XML, JSON, any specified format is a better machine-to-machine format than CSV. I've seen the JSON-object-per-newline pattern a few times, but why not use a JS
by dtech 9y ago
XML, JSON, any specified format is a better machine-to-machine format than CSV.
I've seen the JSON-object-per-newline pattern a few times, but why not use a JSON array then? Then the whole file remains valid JSON.
- ex3ndr 9y agoThis is just easier to implement line-by-line processing than hacking into JSON parsers for this.
- dalailambda 9y agoIn my experience the reason for a JSON object per line is because a tool can then split the entire file by newlines and have a list of objects to start parsing/processing in parallel, which avoids having to parse the entire file up front to get usable data, and lets the tool start processing things while some data is still being parsed.