I have the following JSON.
<code>{"foo": [
{
"bar": "baz"
},
{
"bar": "baz"
},
{
"bar": "baz"
}
]
}
</code>
<code>{"foo": [
{
"bar": "baz"
},
{
"bar": "baz"
},
{
"bar": "baz"
}
]
}
</code>
{"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”
New contributor
Rao Komar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.