cat test.json | jq -c '.[]' > testNDJSON.json

jq is a language that consists of filters on input data to convert it into a specific output

-c:

By default, jq pretty-prints JSON output. Using this option will result in more compact output by instead putting each JSON object on a single line.

'.[]'

input

[{“name”:”JSON”, “good”:true}, {“name”:”XML”, “good”:false}]

Output

{“name”:”JSON”, “good”:true}{“name”:”XML”, “good”:false}

For more details and examples, you can find them at this manual.

Data Scientist: Keep it simple.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store