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

Convert JSON array of key/value pairs into values with a comma seperator using jq

$
0
0

I have the following JSON.

{"foo": [      {"bar": "baz"      },      {"bar": "baz"      },      {"bar": "baz"      }    ]}

I'd like to convert this using jq into the following

"baz", "baz", "baz"

How do I do this using jq without any flags?

.foo.[].bar using https://jqplay.org/ gets you to having them on separate lines with no comma between them, but I need them to have commas in between and be on the same line.

"baz""baz""baz"

Viewing all articles
Browse latest Browse all 657

Trending Articles