I would like to take the json output of window values from a program. The output of it currently is:
JavaScript
x
[
3067,
584
]
[
764,
487
]
But I need it to be formatted like: 3067,584 764x487
. How would I go about doing this using jq or other commands?
I’m not very experienced with jq and json formatting in general, so I’m not really sure where to start. I have tried looking this up but am still not really sure how to do it.
Advertisement
Answer
A solution that does not --slurp
would be using input
for every other array:
JavaScript
jq -r 'join(",")+" "+(input|join("x"))'
JavaScript
3067,584 764x487