LibreOffice Calc 是否支持 JSON 文件导入/排序?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22534203/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-03 17:13:04  来源:igfitidea点击:

Does LibreOffice Calc support JSON file importing/sorting?

jsonsortingimportlibreoffice-calc

提问by Joe

I've been trying to import a couple of .json files into LibreOffice Calc.

我一直在尝试将几个 .json 文件导入 LibreOffice Calc。

Although I can get the raw data in, it isn't sorting as I would think it might (by placing different pieces of info into each cell).

虽然我可以获取原始数据,但它并没有像我想象的那样排序(通过将不同的信息放入每个单元格)。

Does LibreOffice provide support for importing JSON files and sorting them out in cells? (In other words, import + sort)?

LibreOffice 是否支持导入 JSON 文件并在单元格中对它们进行排序?(换句话说,导入+排序)?

If there doesn't seem to be direct support for this, would converting to CSV be the next logical step in order to get the data into Calc?

如果似乎没有对此的直接支持,那么转换为 CSV 是否是将数据导入 Calc 的下一个合乎逻辑的步骤?

回答by Ivan ?urdinjakovi?

Had the same problem myself (that's how I found this question).

我自己也有同样的问题(这就是我发现这个问题的方式)。

So, for the next person finding this - the answer is no - LibreOffice Calc does not support direct import of JSON.

因此,对于下一个发现此问题的人 - 答案是否定的 - LibreOffice Calc 不支持直接导入 JSON。

And the next logical step indeed is converting to CSV. There are free online JSON to CSV converters, and using one of them (http://www.convertcsv.com/json-to-csv.htm), I was easily able to make a correct CSV which Calc imports without a problem.

下一个合乎逻辑的步骤确实是转换为 CSV。有免费的在线 JSON 到 CSV 转换器,使用其中一个(http://www.convertcsv.com/json-to-csv.htm),我可以轻松地制作一个正确的 CSV,Calc 可以毫无问题地导入它。

One possible caveat is if you have complex objects represented in JSON - that may not be convertible to CSV, but then again, if it doesn't fit into CSV, it probably doesn't fit into spreadsheet format either.

一个可能的警告是,如果您有以 JSON 表示的复杂对象 - 它可能无法转换为 CSV,但话说回来,如果它不适合 CSV,它也可能不适合电子表格格式。

回答by Jon G - Megaphone Tech

There's a LibreOffice GetRest pluginwith documentation written in broken English, that has a "parseJSON" formula. It won't convert JSON to CSV (without a lot of grunt work) but it might help your use case.

有一个LibreOffice GetRest 插件,其中包含用蹩脚英语编写的文档,其中包含一个“parseJSON”公式。它不会将 JSON 转换为 CSV(没有大量繁重的工作),但它可能对您的用例有所帮助。

回答by J. Chomel

If you can run Python scripts in Libreoffice Calc, then it should be possible when you see what's in here: http://blog.appliedinformaticsinc.com/how-to-parse-and-convert-json-to-csv-using-python/

如果您可以在 Libreoffice Calc 中运行 Python 脚本,那么当您看到这里的内容时应该是可能的:http: //blog.appliedinformaticsinc.com/how-to-parse-and-convert-json-to-csv-using- Python/