I have files with 1 json document per row and the fields start_id
and end_id
in each document. I'd like to use jq to extract these and print them on the same row.
So far I have:
cat part* | jq '"\(.start_id) \(.end_id)"' | sed s/\"//g | head
This works, but I need the sed
to remove the double quotes.
In order to improve my jq-foo, is there a way to do this without using sed?
e.g. given
{"start_id":1,"end_id":50}
{"start_id":50,"end_id":99}
{"start_id":99,"end_id":12}
get
1 50
50 99
99 12
instead of
"1 50"
"50 99"
"99 12"