Quantcast
Channel: Active questions tagged jq - Stack Overflow
Viewing all articles
Browse latest Browse all 657

jq: error: tostring/1 is not defined at , line 1:

$
0
0

I have a json array of objects in which I would like to create some string using some values. What I tried was:

cat a.json | jq 'map(.id+" "+tostring(.time))'

It gives the error:

jq: error: tostring/1 is not defined at <top-level>, line 1:

If I omit the tostring, then the problem is of course that time is not a string but a number.

Is there a way to do this? I could do a workaround using sed+tr, but it is inelegant.


Viewing all articles
Browse latest Browse all 657

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>