I have json log file like {"type":"1","fname":"AAA","lname":"bbb" } {"type":"2","state":"gujarat" } {"type":"3","city":"ahmedabad" } {"type":"3","city":"rajkot" } {"type":"1","fname":"ccc","lname":"ddd" }
I run following command jq -c "select(.type==\"1\")|{fname:.fname}" > type_1.txt jq -c "select(.type==\"2\")|{city:.city}" > type_3.txt
Is anyway to run jq command only one time and generate 2 output files?
Aucun commentaire:
Enregistrer un commentaire