Skip to content

Instantly share code, notes, and snippets.

@afirth
Created August 2, 2022 21:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save afirth/d735b2630f0e78889c4b7e64110ac747 to your computer and use it in GitHub Desktop.
Save afirth/d735b2630f0e78889c4b7e64110ac747 to your computer and use it in GitHub Desktop.
parse ita matrix json into csv with jq
for f in *.json; do
jq -r '. | .ext.totalPrice, (.itinerary.slices[].segments[] |[.carrier.code, .flight.number, .legs[].origin.code, .legs[].departure, .legs[].destination.code, .legs[].arrival] | @csv)' < $f
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment