Here is my json:
[
{
"ReferringUrl": "N",
"OpenAccess": "0",
"ItmId": "1694738780"
},
{
"ReferringUrl": "L",
"OpenAccess": "1",
"ItmId": "1347809133"
}
]
I want it back to the original json format:
[{"ReferringUrl": "N","OpenAccess": "0","ItmId": "1694738780"},{"ReferringUrl": "L","OpenAccess": "1","ItmId": "1347809133"}]
How to use jq to do this? :) Thank you!
Just use the --compact-output
/ -c
option:
cat file | jq -c
(or, without feline abuse: jq -c '.' file
)