I have a list of ugly looking JSON objects in a text file, one per line. I would like to make them print nicely and send the results to a file.
My attempt to use the command-line python version of json.tool:
parallel python -mjson.tool < jsonList
However, something seems to be going wrong in the parsing of this json, as python's json.tool attempts to open it as multiple arguments and thus throws:
IOError: [Errno 2] No such file or directory: {line contents, which contain single quotes, spaces, double quotes}
How can I compel this to treat each line-separated object as a single argument to the module? Opening the file directly in python and processing it serially is an inefficient solution because the file is enormous. Attempting to do so pegs the CPU.