I would like to hear your suggestions on how to handle a large (40MB) JSON file on Ubuntu. I would like to see it pretty printed in vim or gedit or any other editor. One can find numerious tutorials on how to prettify the JSON, however, they do not have to deal with large input. I also imagine I could pipe the data through pygments or any other syntax highlighter. I am curious to hearing your ideas.
Example download:
wget -O large-dataset.json http://data.wien.gv.at/daten/wfs?service=WFS&request=GetFeature&version=1.1.0&typeName=ogdwien:BAUMOGD&srsName=EPSG:4326&outputFormat=json
Please mind the download size!
EDIT: I found out that meld is working somewhat. The application does not load the whole file at once which would block the user interface. Instead it sequentially reads the file content.
It can be accessed directly from the Command Palette (Ctrl[Cmd]+Shift+P ) where you can search for JSON minify or prettify. You can go Ctrl[Cmd]+Alt+P to directly prettify the selected text or and Alt+M to minify it.
Vim is a file opener software that can be used to open the JSON file on Linux platform. GitHub Atom is a cross-platform tool to open JSON files. Other than these tools, you can use web browsers like Google Chrome and Mozilla Firefox to open JSON files, which we discuss in detail later.
Python JSON's module can do this too (python -m json.tool
), e.g.:
cat myjsonfile.json | python -m json.tool > pretty.json
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With