Tuesday, November 29, 2011

Python & ruby saves json output

At first I was disgusted by json output. then python made it pretty. thanks python

cat t2.json | python -mjson.tool
you can do the same thing with ruby albeit longer:
cat t2.json | ruby -e "require 'rubygems'; require 'json'; puts JSON.pretty_generate(JSON[STDIN.read]);"

No comments:

Post a Comment