jq remove empty objects from objects array #3169
-
The following command removes empty entries from jq: Sample[
{
"a": "1"
},
{},
{
"a": "2"
},
{}
] Output desired[
{
"a": "1"
},
{
"a": "2"
}
] |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
Beta Was this translation helpful? Give feedback.
-
@lamyergeier - Many usage questions about jq already have answers at the jq FAQ or stackoverflow.com. In future, if you find your question about usage does not have a satisfactory answer at one of these locations, please post your question at stackoverflow.com using the jq tag. |
Beta Was this translation helpful? Give feedback.
del(.[] | select(. == {}))