$ jq '.fruits|del(.count,.open)|with_entries(.value |= .price)' fruits.txt { "apple": 2, "banana": 3 } # with_entries(f) is an alias for to_entries | map(x) | from_entries jq '.fruits|del(.count,.open)|to_entries|map(.value |= .price)|from_entries' f { "apple": 2, "banana": 3 } $ jq '.fruits|del(.count,.open)|[to_entries[]|{(.key): .value.price}]|add' fruits.txt { "apple": 2, "banana": 3 }