Data / JSON

This tool is a lifesaver when working with JSON and needing to parse through large amounts of it quickly

cat ~/Downloads/nextgen_lab_data.json | jq -r '.[] as $parent | $parent.analytes[] | select(.dorsata_analyte_key == null) | {lab: $parent.description, analyte: .analyte_data.analytename, value: .analyte_data.value}' > ~/Downloads/lab_output.json

CSV Output from a nested JSON object (Grab the title of each field and each of its options, if it has any)