Skip to content

Latest commit

 

History

History
14 lines (7 loc) · 310 Bytes

jq.md

File metadata and controls

14 lines (7 loc) · 310 Bytes

Count the items in an array:

jq '.|length' foo.json

Get an attribute (e.g. name) for each object in an array:

jq -r .[].name foo.json

(The -r is to get the strings without quotes.)

For each object in an array, print two attributes:

jq -r '.[] | [.itemid, .warehouse] | @tsv' < items.json