3 ms·
jq has made it easier to munge complex data from many non-unixy apps, but then you have to learn how to write complex jq expressions. Something like sql applied
by peterwwillis 8y ago
jq has made it easier to munge complex data from many non-unixy apps, but then you have to learn how to write complex jq expressions. Something like sql applied to json might make this easier.
- JasonFruit 8y agojq is an amazing tool, and I wish I used it frequently enough to remember how without looking it up.
- andrewla 8y agoI've mostly switched to using gron [1] for these applications -- the operation is much simpler and doesn't depend on learning a new DSL for manipulating json. I have to manipulate JSON data just enough to want to have a tool better than just firing up node and running something, but not a complete new language. With gron I can just wire it up to a bunch of standard line-based utilities. [1] https://github.com/tomnomnom/gron https://github.com/tomnomnom/gron
- FraaJad 8y agowhile I get what gron is trying to do, I do not have an intuitive grasp of how to use it. Do you have an example that you wrote/learnt from?
- forinti 8y agoI managed to write a Telegram bot in ash (in OpenWRT) because it had a little program called jsonfilter. It's not as powerful as jq, but quite useful.
- oftenwrong 8y agoI find myself frequently reaching for 'gron' when I need to deal with JSON in a script. It's a bit simpler than 'jq', both in usage and in capability. https://github.com/tomnomnom/gron https://github.com/tomnomnom/gron