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