Quantcast
Channel: Active questions tagged jq - Stack Overflow
Viewing all articles
Browse latest Browse all 657

jq how to merge multiple arrays?

$
0
0

I have the following data, the output of multiple jq pipes:

 [   {"Russia": 1073849   } ] [   {"Spain": 593730   } ] [   {"France": 387252   } ] [   {"UK": 371125   } ]

My desired output is:

 [   {"Russia": 1073849   },   {"Spain": 593730   },   {"France": 387252   },   {"UK": 371125   } ]

Based on similar questions I tried '.[]|transpose|map(add)' and it gives an error: Cannot index object with number. Also I cannot group_by(key) because there is no common key in the objects.


Viewing all articles
Browse latest Browse all 657

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>