如何查看在Ubuntu上漂亮打印的大JSON文件? [英] How to see a large JSON file pretty printed on Ubuntu?

查看:407
本文介绍了如何查看在Ubuntu上漂亮打印的大JSON文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想听听您关于如何在Ubuntu上处理大型(40MB)JSON文件的建议.我想在 vim gedit 或任何其他编辑器中很好地打印它.人们可以找到许多有关如何美化JSON的教程,但是,它们不必处理大量输入.我还想象我可以通过 pygments 或任何其他语法突出显示工具来传递数据.我很好奇您的想法.

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.

示例下载:

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

请注意下载大小!

编辑:我发现融合有点起作用.应用程序不会立即加载整个文件,这会阻塞用户界面.而是顺序读取文件内容.

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.

推荐答案

Python JSON的模块也可以做到这一点(python -m json.tool),例如:

Python JSON's module can do this too (python -m json.tool), e.g.:

cat myjsonfile.json | python -m json.tool > pretty.json

这篇关于如何查看在Ubuntu上漂亮打印的大JSON文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆