const xlsx = require('node-xlsx')
const fs = require('fs')
const sheet = xlsx.parse('xxx.xlsx');
const data = sheets[0].data;
let jsonList = [];
data?.forEach((item, index) => {
if (index === 0) {
return
} else {
jsonList.push({
a: item[0],
b: item[1],
c: item[2]
})
}
})
fs.writeFileSync('./xxx.json', JSON.stringify(jsonList));
node处理.xlsx文件转换JSON
最新推荐文章于 2023-12-01 11:17:46 发布