如何将 Xlsx / Xls 文件转换为 JSON 文件例如 sample.jsonNode JS

问题描述

enter image description here

我正在尝试将此 Excel 表/文件转换为 json 文件作为输出而不是原始数据 (sample.json),我在谷歌上搜索了许多资源,但没有找到任何工作代码或教程,所以我需要一些帮助,我有作为excel数据的链接图像以及如何将其转换为如下的json文件并将其上传到MongoDB中。

sample.json

{
"Sheet1": [
    {
        "Qusetion Number": "1","Question": "A program language","A": "defines the form of the instruction","B": "is always machine dependent","C": "is never machine dependent","D": "All of the above","E ": "None of the above","Answers": "defines the form of the instruction"
    },{
        "Qusetion Number": "2","Question": "Quiestion 2","A": "Option A","B": "Option B","C": "Option C","D": "Option D","E ": "Option E ","Answers": "Option C"
    },{
        "Qusetion Number": "3","Question": "Question 3","A": "Option 5","B": "Option 6","C": "Option 9","E ": "Option9","Answers": "Option 6"
    },{
        "Qusetion Number": "4","Question": "Question 4","A": "456","B": "221","C": "889","Answers": "456"
      }
    ]
  }

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)