Does LibreOffice Calc support JSON file importing/sorting?

只愿长相守 提交于 2019-12-05 08:41:24

问题


I've been trying to import a couple of .json files into 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)?

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?


回答1:


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.

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.

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.




回答2:


There's a LibreOffice GetRest plugin with 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.




回答3:


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/



来源:https://stackoverflow.com/questions/22534203/does-libreoffice-calc-support-json-file-importing-sorting

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!