I am trying to parse a JSON document and print a couple of values in one line. Is there any way to accept the following document:
{
"fmep": {
"foo": 112,
"bar": 234324,
"cat": 21343423
}
}
And spit it out:
112 234324
I can get the values I want, but they are printed on separate lines:
$ echo '{ "fmep": { "foo": 112, "bar": 234324, "cat": 21343423 } }' | jq '.fmep|.foo,.bar'
112
234324
If there is an example showing how to do this, I would appreciate any pointers.
source
share