Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • 1
    Thank you so much, I never would have worked all that out! I agree, seeing it all written out like that, it does seem a bit like overkill. I thought it might be a bit simpler but I'm an absolute amateur with jq. Commented Apr 11 at 23:56
  • 1
    @localhost Understandable. I think over time as you get more experience you'll develop an intuition that tells you jq is not the ideal tool for a task like this. It's a bit hard to explain, but off the top of my head the main factors that I've seen tend to make jq well suited are (1) your input and output both have to be JSON and there is no plain-text alternative, (2) there are many records that need to be processed similarly, and (3) your processing logic is primarily structural transformations, i.e. moving around objects and strings and numbers, rather than changing them. Commented Apr 12 at 23:07