Best way to convert excel file into a JSON file?

心已入冬 提交于 2020-04-18 12:35:04

问题


I have data saved in a Microsoft excel file. I need to turn that data into something that a Lambda function can parse.

I think the best way to do this is to convert the excel file into a JSON file (and then my Lambda function can read and parse it).

What's the best way to do this?

To convert the excel data file into a JSON file, I have found some handy online converter tools, like this one. It seems to work.

However, that converter and others add in \r wherever there are line breaks in the data, and \ wherever there are quotes in the data. (the line breaks and especially quotes need to be in the data)

So to properly read the data in the JSON file, I have to then get rid of these changes to the raw data.

Is there another way to do this? Such as a converter that does not change the raw data in this way? Or some method other than a converter?

Once the raw data has been changed (by adding in stuff like \r and \ like I mention above), it becomes cumbersome to remove it. I can do a find/replace to get rid of the changes, but that adds steps that can become costly time wise. And using regex could add performance hits.

**EDIT: Note that I probably need a method that creates an actual document (so a program that produces the data in a client browser would not work). I am looking to create an actual document that my Lambda can then analyze. **

来源:https://stackoverflow.com/questions/60580598/best-way-to-convert-excel-file-into-a-json-file

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