4 ms·
Why not jq, then?
by fiatjaf 8y ago
Why not jq, then?
- danielhlockard 8y agojq is a json parsing tool, no?
- roganartu 8y agoA very powerful one. You could in theory stream multiple files into jq and have it output effectively arbitrary JSON based on their contents since it supports conditionals. I don't think it would be very pretty since it's not designed for that use case, but the jq language is certainly powerful enough to allow it.
- fiatjaf 8y agoIt can be used to generate JSON using functions, input data, conditional expressions and anything you want.
- babo 8y agoWith a deep enough JSON structure with similar enough items, the jq expressions are hard to make or maintain. This is a real world example: jq '.sourceSelectionTrees[].rootNode.children[].children' | jq '.[]? | .action.attributeMapping.attributeSources' | jq -r '.[]? | select(.type == "XYZ") | .dataRef.id'