[英]excel data to json using nodejs
在这里我需要将我的excel转换为json,因为我只在正确的路径文件中。运行时显示以下错误:
[TypeError:无法设置只有吸气剂的[object Object]的属性长度]有帮助吗?
node_x = require(“ xls-to-json”); var stack = new Error()。stack;
try{
node_x({
input: "Book1.xls", // input xls
output: "output.json" // output json
}, function(err, result) {
if(err) {
console.error(err);
} else {
console.log(result);
}
});
}catch(e){
console.log("ssfffs");
console.error(e);
}
也尝试输入工作表名称
node_xj = require("xls-to-json");
node_xj({
input: "Book1.xls", // input xls
output: "output.json", // output json
sheet: "sheetname" // specific sheetname
}, function(err, result) {
if(err) {
console.error(err);
} else {
console.log(result);
}
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.