首先安装依赖库node-xlsx

npm install node-xlsx

 

在操作文件中直接引用

var xlsx = require("node-xlsx");

读取excel

var list = xlsx.parse("./excel/" + excelName);

//读出后是数组,包含每个sheet

[

    { name: 'sheet1',data: [ [Object], [Object], [Object], [Object], [Object] ] },
    { name: 'sheet2', data: [ [Object] ] }

]

name=sheet名称

data=每个sheet的数据,

剩下的就灵活操作咯......

相关文章:

  • 2021-07-05
  • 2021-05-28
  • 2021-12-26
  • 2022-12-23
  • 2021-12-27
  • 2021-12-03
  • 2021-11-16
猜你喜欢
  • 2022-02-20
  • 2021-10-13
  • 2021-10-23
  • 2021-10-30
  • 2022-12-23
  • 2021-09-24
  • 2022-02-01
相关资源
相似解决方案