Skip to content

Instantly share code, notes, and snippets.

@sreepurnajasti
Created August 28, 2018 05:26
Show Gist options
  • Save sreepurnajasti/1b163251b6cfe2e189e1a4683b852981 to your computer and use it in GitHub Desktop.
Save sreepurnajasti/1b163251b6cfe2e189e1a4683b852981 to your computer and use it in GitHub Desktop.
Reading xlsx, csv files using exceljs in node
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