-
-
Save CuongNgMan/5e6fd0a08cb93282ebb702c454a66753 to your computer and use it in GitHub Desktop.
Reading xlsx, csv files using exceljs in node
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Excel = require('exceljs'); | |
var workbook = new Excel.Workbook(); | |
workbook.xlsx.readFile('../../storage/cust_88ae31d4-47c5-4f70-980e-7b473ba20ef9/xls.xls') | |
.then(function() { | |
var worksheet = workbook.getWorksheet('Sheet1'); | |
worksheet.eachRow({ includeEmpty: true }, function(row, rowNumber) { | |
console.log("Row " + rowNumber + " = " + JSON.stringify(row.values)); | |
}); | |
}); | |
workbook.csv.readFile('../../storage/cust_88ae31d4-47c5-4f70-980e-7b473ba20ef9/gd1.csv') | |
.then(function(worksheet) { | |
worksheet.eachRow({ includeEmpty: true }, function(row, rowNumber) { | |
console.log("Row " + rowNumber + " = " + JSON.stringify(row.values)); | |
}); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment