Comment

Comment by labelbias

Just recently used xq to convert and clean up a bunch of weird xml files to JSON. It was such a breeze.

I love how nested lists inside objects can expand into a particular one with the .[] operator.

For example:

{ a: [{b: 5}, {b: 3}], c: 5} can be transformed into: [{ b: 5, c: 5}, {b: 3, c: 5}] using jq '{c: .c, b: .a[].b}'

For heavily nested XMLs I can get a nice flat output.

parent labelbias 6 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton