I have json like this:
[ {"one": 1}, {"two": 2}]
and wish to convert it to this format:
{"one": 1}
{"two": 2}
to facilitate indexing it into ElasticSearch. (latter is called 'jsonl' format). JQ is my tool of preference but I can't figure out how to do this. Thanks
The key is the -c command-line option, which produces JSONL:
jq -c '.[]' test_array.json
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With