Skip to content

Instantly share code, notes, and snippets.

@hukl
Created March 21, 2012 15:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hukl/2148571 to your computer and use it in GitHub Desktop.
Save hukl/2148571 to your computer and use it in GitHub Desktop.
Format / Tidy a big junk of json
With Python
cat big.json | python -mjson.tool > ~/Desktop/big_tidy.json
With Ruby (Keeps the order of the keys in ruby 1.9.x)
cat big.json | ruby -e 'require "json"; puts JSON.pretty_generate(JSON.parse(STDIN.read)) ' > big_tidy.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment