You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
390 B
21 lines
390 B
// Requiring the module
|
|
const reader = require('xlsx')
|
|
|
|
// Reading our test file
|
|
const file = reader.readFile('./test.xlsx')
|
|
|
|
let data = []
|
|
|
|
const sheets = file.SheetNames
|
|
|
|
for(let i = 0; i < sheets.length; i++)
|
|
{
|
|
const temp = reader.utils.sheet_to_json(
|
|
file.Sheets[file.SheetNames[i]])
|
|
temp.forEach((res) => {
|
|
data.push(res)
|
|
})
|
|
}
|
|
|
|
// Printing data
|
|
console.log(data) |