jq

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

jq [2020/02/25 08:52] – created tomjq [2020/02/25 08:53] (current) – tom
Line 3: Line 3:
 Filtering an array of objects where the ''user_id'' is ''2199'' and outputting just the ''username'' key: Filtering an array of objects where the ''user_id'' is ''2199'' and outputting just the ''username'' key:
  
-  cat profiles.json | jq -c '.[] | select(.user_id | contains(2199)) | .username' -r+  cat profiles.json | jq -c -r '.[] | select(.user_id | contains(2199)) | .username'
  
  
  • jq.1582617126.txt.gz
  • Last modified: 2020/02/25 08:52
  • by tom