How to sort a json file by keys and values of those keys in jq
We're building a website using the Pentaho CTools library, which has a graphical dashboard editor which writes out JSON-format files for part of the dashboard.I'd like to apply a transform to these...
View ArticleHow to check if element exists in array with jq
I have an array and I need to check if elements exists in that array or to get that element from the array using jq, fruit.json:{"fruit": ["apple", "orange","pomegranate","apricot","mango" ]}cat...
View ArticleHow to get JQ to retain comma separation between matched records in the output
I'm attempting to use windows cmder.exe (or standard command prompt) to execute jq commands for command-line JSON processor to transform and output existing JSON files I have saved. I've had success...
View Articlejq group by both outer and inner value within arrays
My data is in the following simplified format[ {"a": "foo","b": [ {"x": 1,"y": true } ] }, {"a": "foo","b": [ {"x": 1,"y": true }, {"x": 99,"y": false } ] }, {"a": "bar","b": [] }]I am trying to get...
View ArticleJQ and Multiple Fields with a SELECT
Let's say I have json returned as such:export json_string='{"summary": "1 failure","checks": [ {"id": "check1","status": "OK" }, {"id": "check2","status": "FAILED" }, {"id": "check3","status":...
View ArticleIs there a way to batch split a file by chapter with ffmpeg and then...
So I made a batch script originally with the ability to relatively precision trim a video into chapters without having to run by keyframes, but the code looks horrible and I can't get it to loop...
View Articlejq: 'empty' variable leads to empty output - is it expected behavior?
In my understanding unused variable in jq query shouldn't affect output, for example this echoes it's input: "bla" as $str | .".However, empty as $var | . produces no output. Is it expected?
View Article