web_fullstack
read excel file in node.js
AI Coder
2020. 7. 31. 21:00
1. npm install read-excel-file
2. 아래와 같이 코딩
const xlsxFile = require('read-excel-file/node');
xlsxFile('./IBIR_input.xlsx').then((rows)=>{
for(var i=1; i<rows.length; i++){
for(var j=0;j<rows[i].length;j++){
console.log("["+i+"]["+j+"]"+rows[i][j]);
}
}
});
Excel Sheet 의 값들은 rows[ROW#][COL#] 형태의 2차 배열로 자동 저장 된다.