json icon indicating copy to clipboard operation
json copied to clipboard

Can I remove properties in a json file?

Open spaceghostu opened this issue 5 years ago • 2 comments

spaceghostu avatar Apr 14 '21 14:04 spaceghostu

% echo '{"one":1, "two":2}' | json -e 'delete this.one'
{
  "two": 2
}

Is this what you mean? Cheers.

trentm avatar Apr 26 '21 00:04 trentm

json -I -f foo.json -e 'delete this.bar'

works well for me!

4096void avatar Mar 17 '23 03:03 4096void