Say I have the input:
{
"name": "John",
"email": "[email protected]"
}
{
"name": "Brad",
"email": "[email protected]"
}
How do I get the output:
[
{
"name": "John",
"email": "[email protected]"
},
{
"name": "Brad",
"email": "[email protected]"
}
]
I tried both:
jq '[. | {name, email}]'
and
jq '. | [{name, email}]'
which both gave me the output
[
{
"name": "John",
"email": "[email protected]"
}
]
[
{
"name": "Brad",
"email": "[email protected]"
}
]
I also saw no options for an array output in the documentations, any help appreciated
[.[] | {name,email}]