Commit 07846306 authored by Mikaël Salson's avatar Mikaël Salson
Browse files Put all the JSON on a single line.

If the JSON is not valid, raises an exception is deleted because has
similar features while checking syntax additionnally.
parent f7bdde36
tr "\n" " " | sed "s/}/}\n/g"
import json
import sys
from collections import OrderedDict
f = sys.stdin
if len(sys.argv) > 1:
f = open(sys.argv[1])
s =
print json.dumps(OrderedDict(json.loads(s, object_pairs_hook=OrderedDict))).replace('\n', ' ')
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment