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

Filter empty and/or null values with jq

$
0
0

I have a file with jsonlines and would like to find empty values.

{"name": "Color TV", "price": "1200", "available": ""}{"name": "DVD player", "price": "200", "color": null}

And would like to output empty and/or null values and their keys:

available: ""color: null

I think it should be something like cat myexample | jq '. | select(. == "")', but is not working.


Viewing all articles
Browse latest Browse all 657

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>