pkoppstein

Results 169 comments of pkoppstein

The bug was fixed by ad8d1a8 around Dec 9, 2015; see #1033 That is, it was fixed AFTER the release of jq 1.5

@e1senh0rn asked: > is there any workaround? What is the alternative behavior you have in mind? Would the -s option be useful for you? Or are you asking for new...

In this post I would like to emphasize that to "branch" on whether the input stream is empty or not, without losing the first item if any, it is not...

Re: partitioner Note that jq has an (undocumented but internally used) builtin, `_nwise/1`, that partitions an array input into arrays of up to the specified length. Its can evidently be...

@emanuele6 - Please note that my two most recent posts above were not addressed to you because they were not intended as a comment on or critique of your contributions....

@emanuele6 - To see the difference, suppose we want to branch on whether the input stream is empty. If jq had a side-effect-free version of isempty/1, we would write something...

@DavidFetter: those defs are not idiomatic. As in @itchyny's second example, it would be more idiomatic for the string to be presented as input to the filter. It would also...

If by "nothing is found" you mean the object does not have the specified key, you would write something like this: $ jq 'if has("b") then .b else empty end'

You could use gojq: ``` echo '"2015-03-05T23:51:47.487Z"' | gojq 'strptime("%Y-%m-%dT%H:%M:%S.%fZ")' [ 2015, 2, 5, 23, 51, 47.486999988, 4, 63 ] ```