Closed anjishnu closed 8 years ago
Hi, can you try with the -ns
flags? I got it working with:
cat <<EOF | python -m oneliner -m json -ns 'j=json.loads(line); j["a"], j["b"] = j["b"], j["a"]; print(json.dumps(j));'
{"a": 1, "b": 2}
{"a": 3, "b": 4}
EOF
{"a": 2, "b": 1}
{"a": 4, "b": 3}
That worked, thanks!
I want to do something like:
I tried statements like
But they all failed.