3 ms·
There's a real need for a tool like jq, but jq unfortunately isn't it. What I mean is this: the functionality offered by jq (parsing json on the command line a
by ur-whale 5y ago
There's a real need for a tool like jq, but jq unfortunately isn't it.
What I mean is this: the functionality offered by jq (parsing json on the command line and extracting what you need from it) is really needed in many modern data processing tasks, but jq's DSL is one of the most horrible thing I've had to learn in recent years.
The only way a casual user of that thing can hope to succeed in actually crafting a working jq query is pray that there is a stack overflow topic answering his exact need.
Here's the way I use jq 99% of the time:
cat somefile.json | jq . | <long pipeline of traditional, well though-out unix text processing tools such as sed, grep, awk, cut, etc...>
And when this doesn't cut it, I write a python script.
- seppel 5y agoYou might prefer gron for this use case: https://github.com/tomnomnom/gron https://github.com/tomnomnom/gron