最初,我尝试使用sheet_to_json方法,该方法将整个sheet数据转换为数组数组。
let sheetData = xlsx.utils.sheet_to_json(workbook.Sheets[sheetsList[i]], {
header: 1,
defval: '',
blankrows: true
});
其次,我尝试使用以下链接:
https://github.com/SheetJS/js-xlsx/issues/214#issuecomment-96843418
但我得到了以下错误:
f:\xxx\node_modules\xlsx\xlsx.js:2774
function decode_range(range) { var x =range.split(":").map(decode_cell); return {s:x[0],e:x[x.length-1]}; }
^
TypeError: Cannot read property 'split' of undefined
我该怎么解决?或者它们是否有其他可用的方法或模块,以便我可以从csv、xlsx、xls中获取数据?
谢谢!