如何将单行JSON文件转换为人类可读的多行文件? [英] How do I convert a single-line JSON file into a human-readable multi-line file?

查看:486
本文介绍了如何将单行JSON文件转换为人类可读的多行文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试编写一个脚本来创建JSON文件,可以将其导入Firefox中作为书签.为了检查Firefox用于书签的结构,我已将所有书签导出到JSON文件.

I am trying to write a script to create JSON files that can be imported into Firefox for bookmarks. In an attempt to examine the structure used by Firefox for bookmarks, I have exported all of my bookmarks to a JSON file.

问题在于Firefox会导出单行文件(很难读取).是否可以使用实用程序将此文件转换为可读的,缩进的多行文件?

The problem is that Firefox exports a single-line file (very hard to read). Is there a utility available to convert this file to a readable, indented, multi-line file?

推荐答案

您可以使用 http://jsbeautifier.org 为此目的.

只需复制&将您的JSON粘贴到文本区域,然后按美化JavaScript或HTML"

Just copy & paste your JSON into the textarea and then press "Beautify JavaScript or HTML"

这篇关于如何将单行JSON文件转换为人类可读的多行文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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