Using Chris Whong's JSON proxy for daycare data, create a CSV file with details of violations for a specific location. Assumes jq is installed.
~$ curl -s http://daycareproxy.herokuapp.com/id/DC20687 \
| jq '.inspections[] | .date as $date | .violations[] | .date |= $date | .id = "DC20687" | [.id,.date,.status,.subSection,.category,.summary] | @csv' \
| sed 's/\\r\\n//g;s/\\//g;s/""/"/g;s/ //g' \
> > violations.csv
Produces a violations.csv
file with the following contents.