2
這是我的第一個問題。糾正我,如果我錯了。我是nodejs新的蜜蜂。我想通過nodejs比較兩個excel文件。我使用了excel-compare模塊來比較兩個excel文件(確實有多張表格)。但它的投擲類型錯誤。這裏是我的代碼Nodejs比較兩個不同的Excel文件並發現其差異
var excel_compare = require("excel-compare");
excel_compare({
file1: 'data/school.xlsx', // file1 is the main excel to compare with
file2: 'data/all.xlsx', // file2 is the file for compare
column_file1: {
column: [1],
join: ''
},
column_file2: {
column: [2],
join: '-'
}
})
當我運行上面的代碼我收到以下錯誤
TypeError: Cannot read property 'value' of undefined
at E:\node_modules\npm\node_modules\excel-compare\index.js:17:35
at Array.forEach (native)
at Function._.each._.forEach (E:\node_modules\npm\node_modules\excel-compare
\node_modules\underscore\underscore.js:79:11)
at E:\node_modules\npm\node_modules\excel-compare\index.js:15:5
at Function._.each._.forEach (E:\node_modules\npm\node_modules\excel-compare
\node_modules\underscore\underscore.js:82:22)
at module.exports (E:\node_modules\npm\node_modules\excel-compare\index.js:1
3:4)
at Object.handle (E:\node_modules\npm\Excel\excelread.js:39:2)
at next_layer (E:\node_modules\npm\node_modules\express\lib\router\route.js:
103:13)
at Route.dispatch (E:\node_modules\npm\node_modules\express\lib\router\route
.js:107:5)
at E:\node_modules\npm\node_modules\express\lib\router\index.js:213:24
任何一個可以幫助我解決這個問題嗎?
當我嘗試使用數值時,出現以下錯誤 TypeError:無法讀取未定義的屬性'1'。 – ShaMoh 2014-10-20 13:44:01
@ user3708542:請確保您使用的數值,而不是字符串值: '欄:[1]' 而不是 '欄:[ '1']' – soulprovidr 2014-10-20 13:53:11
試圖以正確的方式我的意思是列:[1] @sholanozie – ShaMoh 2014-10-20 14:06:23