3 ms·
it should be trivial to write a tool to stream a json file with proper newlines
by beached_whale 9y ago
it should be trivial to write a tool to stream a json file with proper newlines
- greglindahl 9y agoNot sure what you're getting at -- my tools that generate json logfiles do trivially add newlines where I want them. jq's "compact" mode will reformat files that don't have newlines where I want them.
- beached_whale 9y agoI mean that the tools to add the newlines to a compact json file with minimal whitespace are not going to be the bottle neck. I am fairly sure that grep uses a forward streaming access pattern and not random access so inserting a relatively simple command into the pipeline to insert newlines, like jq, probably isn't going to slow it down. The tool itself wouldn't be difficult to write, or like you said, just use jq