News for hackers. Stuff that matters.
Re:Jq – A Command-line JSON processor by drdoom on Monday April 27, 2015 @02:51PM (#9448383)
Looks interesting. Given this json, [{"name":"john", "grades":[1,2,3]}, {"name":"jane", "grades":[4,5,6]}], can it print it out as this: john,1 john,2 john,3 jane,4 jane,5 jane,6
Re:Jq – A Command-line JSON processor by aquassaut on Monday April 27, 2015 @03:57PM (#9448710)
Yes, kind of like so:

echo '[{"name":"john", "grades":[1,2,3]}, {"name":"jane", "grades":[4,5,6]}]'| jq '.[]| "\(.name), \(.grades|.[])"'

Re:Jq – A Command-line JSON processor by drdoom on Monday April 27, 2015 @04:21PM (#9448844)
Thanks! Now, it looks more interesting...
Re:Jq – A Command-line JSON processor by devy on Monday April 27, 2015 @06:01PM (#9449368)
Based on @aquassaut's answer, I tweaked it a little, and this should do it.

echo '[{"name":"john", "grades":[1,2,3]}, {"name":"jane", "grades":[4,5,6]}]' | jq -r '.[] | "\(.name),\(.grades|.[])"' | paste -sd' ' -