因此,根据官方文档,我应该能够使用以下方式阅读excel文档:
// read from a file
var workbook = new Excel.Workbook();
workbook.xlsx.readFile(filename)
.then(function() {
// use workbook
});
// pipe from stream
var workbook = new Excel.Workbook();
stream.pipe(workbook.xlsx.createInputStream());
我有以下文件:
我需要做的就是将每一行加载到一个对象中:
var excelObject = {competence1: '', competence2: ''}
然后将其保存到数组中。
然而,文档并没有给我更多关于我如何阅读这个文件。它使用一个名为stream
的变量,但是这个变量在任何地方都没有解释。
有谁知道这个插件并知道我如何实现我的目标?
答案 0 :(得分:12)
var workbook = new Excel.Workbook();
workbook.xlsx.readFile(filename)
.then(function() {
var worksheet = workbook.getWorksheet(sheet);
worksheet.eachRow({ includeEmpty: true }, function(row, rowNumber) {
console.log("Row " + rowNumber + " = " + JSON.stringify(row.values));
});
});
答案 1 :(得分:6)
如果您使用文件作为ArrayBuffer(例如文件是在客户端上使用FileReader.readAsArrayBuffer()读取的),那么要使用此lib加载它,您必须执行下一步:
let workbook = new Excel.Workbook();
let stream = new Stream.Readable();
stream.push(file); // file is ArrayBuffer variable
stream.push(null);
workbook.xlsx.read(stream).then((workbook)=> {
// get worksheet, read rows, etc
});
答案 2 :(得分:1)
以下代码段将帮助您读取文件sample.xlsx,其中包含两列1.用户名2.密码。我试图用Mocha(chai)断言,检查数据类型匹配。
var Excel = require('exceljs');
const assert = require("chai").assert;
var workbook = new Excel.Workbook();
workbook.creator ="Naveen";
workbook.modified ="Kumar";
workbook.xlsx.readFile("sample.xlsx").then(function(){
var workSheet = workbook.getWorksheet("one");
workSheet.eachRow({ includeEmpty: true }, function(row, rowNumber) {
currRow = workSheet.getRow(rowNumber);
console.log("User Name :" + currRow.getCell(1).value +", Password :" +currRow.getCell(2).value);
console.log("User Name :" + row.values[1] +", Password :" + row.values[2] );
assert.equal(currRow.getCell(2).type, Excel.ValueType.Number);
// console.log("Row " + rowNumber + " = " + JSON.stringify(row.values));
});
})
希望这有助于某人
答案 3 :(得分:1)
//Read a file
var workbook = new Excel.Workbook();
workbook.xlsx.readFile("data/Sample.xlsx").then(function () {
//Get sheet by Name
var worksheet=workbook.getWorksheet('Sheet1');
//Get Lastrow
var row = worksheet.lastRow
//Update a cell
row.getCell(1).value = 5;
row.commit();
//Save the workbook
return workbook.xlsx.writeFile("data/Sample.xlsx");
});
答案 4 :(得分:0)
第一步:使用npm下载exceljs模块
Step2:使用以下代码从excel读取数据
CREATE TABLE `adcategory` (
`id` int(99) NOT NULL,
`adid` varchar(99) NOT NULL,
`cattype` varchar(99) NOT NULL,
`catvalue` varchar(99) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `adcategory` (`id`, `adid`, `cattype`, `catvalue`) VALUES
(15, 'a98e7e97e2', '1', '1'),
(16, 'a98e7e97e2', '2', '2'),
(17, 'ad129031b6', '1', '1'),
(18, 'ad129031b6', '2', '2'),
(19, '0906c4d03d', '1', '1'),
(20, '0906c4d03d', '2', '2'),
(21, '09120c53c7', '1', '1'),
(22, '09120c53c7', '2', '2'),
(23, '09b8369032', '1', '2'),
(24, '09b8369032', '2', '1'),
(25, '7044c7a086', '1', '2'),
(26, '7044c7a086', '2', '1'),
(27, '7065f93e14', '1', '1'),
(28, '7065f93e14', '2', '2'),
(29, '70e57235fd', '1', '2'),
(30, '70e57235fd', '2', '1'),
(31, 'fd7a623a9d', '1', '1'),
(32, 'fd7a623a9d', '2', '2'),
(33, 'fd7a623a9d', '3', '2'),
(34, 'fd81353461', '1', '1'),
(35, 'fd81353461', '2', '2'),
(36, 'fd81353461', '3', '2'),
(37, 'fd8762b7c2', '1', '1'),
(38, 'fd8762b7c2', '2', '2'),
(39, 'fd8762b7c2', '3', '2'),
(40, 'fd8f011e8a', '1', '1'),
(41, 'fd8f011e8a', '2', '2'),
(42, 'fd8f011e8a', '3', '2'),
(43, 'fd9d60b084', '1', '1'),
(44, 'fd9d60b084', '2', '2'),
(45, 'fd9d60b084', '3', '2'),
(46, 'fda24d8327', '1', '1'),
(47, 'fda24d8327', '2', '2'),
(48, 'fda24d8327', '3', '2'),
(49, 'fda8203702', '1', '1'),
(50, 'fda8203702', '2', '2'),
(51, 'fda8203702', '3', '2'),
(52, 'fda8ca38e1', '1', '1'),
(53, 'fda8ca38e1', '2', '2'),
(54, 'fda8ca38e1', '3', '2'),
(55, 'fda97268c1', '1', '2'),
(56, 'fda97268c1', '2', '2'),
(57, 'fda97268c1', '3', '2'),
(58, 'fdb5f4f569', '1', '2'),
(59, 'fdb5f4f569', '2', '2'),
(60, 'fdb5f4f569', '3', '2'),
(61, 'fdbc31a522', '1', '2'),
(62, 'fdbc31a522', '2', '2'),
(63, 'fdbc31a522', '3', '2'),
(64, 'fdc85be575', '1', '2'),
(65, 'fdc85be575', '2', '2'),
(66, 'fdc85be575', '3', '2'),
(67, '0b4da6e344', '1', '1'),
(68, '0b4da6e344', '2', '2'),
(69, '0b4da6e344', '3', '2'),
(70, '0bb36c6c89', '1', '2'),
(71, '0bb36c6c89', '2', '1'),
(72, '0c00cd00d3', '1', '1'),
(73, '0c00cd00d3', '2', '2'),
(74, '0c00cd00d3', '3', '2'),
(75, '0c046278c6', '1', '1'),
(76, '0c046278c6', '2', '2'),
(77, '0c046278c6', '3', '2'),
(78, '0c0e4bf06b', '1', '2'),
(79, '0c0e4bf06b', '2', '2'),
(80, '0c0e4bf06b', '3', '2'),
(81, '0c140b726b', '1', '2'),
(82, '0c140b726b', '2', '2'),
(83, '0c140b726b', '3', '2'),
(84, '0f6e44804f', '1', '2'),
(85, '0f6e44804f', '2', '2'),
(86, '0f6e44804f', '3', '2'),
(87, '0f857cce9a', '1', '1'),
(88, '0f857cce9a', '2', '2'),
(89, '0f857cce9a', '3', '2'),
(90, '0ff41014f1', '1', '1'),
(91, '0ff41014f1', '2', '2'),
(92, '0ff41014f1', '3', '2'),
(93, '101f76e659', '1', '2'),
(94, '101f76e659', '2', '2'),
(95, '101f76e659', '3', '2'),
(96, '1026497b37', '1', '1'),
(97, '1026497b37', '2', '2'),
(98, '1026497b37', '3', '2'),
(99, '15df6d4a01', '1', '2'),
(100, '15df6d4a01', '2', '1'),
(101, '15e2329fa0', '1', '1'),
(102, '15e2329fa0', '2', '2'),
(103, '15e2329fa0', '3', '2'),
(104, '15e4e85639', '1', '1'),
(105, '15e4e85639', '2', '2'),
(106, '15e4e85639', '3', '2');
CREATE TABLE `adpost` (
`id` int(99) NOT NULL,
`adid` varchar(99) NOT NULL,
`propertyid` varchar(99) NOT NULL,
`value` varchar(99) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `adpost` (`id`, `adid`, `propertyid`, `value`) VALUES
(49, 'a98e7e97e2', '1', 'ad 1'),
(50, 'a98e7e97e2', '2', '0'),
(51, 'a98e7e97e2', '3', '120'),
(52, 'a98e7e97e2', '4', 'z'),
(53, 'ad129031b6', '1', 'teasss'),
(54, 'ad129031b6', '2', '1'),
(55, 'ad129031b6', '3', '120'),
(56, 'ad129031b6', '4', 'sdfr'),
(57, '0906c4d03d', '1', 'test 11111111'),
(58, '0906c4d03d', '2', '1'),
(59, '0906c4d03d', '3', '21'),
(60, '0906c4d03d', '4', 'asasassassa'),
(61, '09120c53c7', '1', 'MySql PDO not passing value from variable in php function'),
(62, '09120c53c7', '2', '1'),
(63, '09120c53c7', '3', '130'),
(64, '09120c53c7', '4', 'sdfghjklkmnbvftyhj'),
(65, '0955d0d4d2', '1', 'MySql PDO not passing value from variable in php function'),
(66, '0955d0d4d2', '2', '1'),
(67, '0955d0d4d2', '3', '130'),
(68, '0955d0d4d2', '4', 'fygvbhnj bkjhljkn,blhuijkn'),
(69, '09b8369032', '1', 'MySql PDO not passing value from variable in php function'),
(70, '09b8369032', '2', '0'),
(71, '09b8369032', '3', '133'),
(72, '09b8369032', '4', 'k;nkldfnsdkfndlkfndsnldsn'),
(73, '7044c7a086', '1', 'isset'),
(74, '7044c7a086', '2', '1'),
(75, '7044c7a086', '3', '123'),
(76, '7044c7a086', '4', 'qwdeqw'),
(77, '7065f93e14', '1', 'why do we use php()?'),
(78, '7065f93e14', '2', '1'),
(79, '7065f93e14', '3', '123'),
(80, '7065f93e14', '5', 'on'),
(81, '7065f93e14', '4', 'qweqweqw'),
(82, '70e57235fd', '1', 'why do we use bindparam()?'),
(83, '70e57235fd', '2', '1'),
(84, '70e57235fd', '3', '111'),
(85, '70e57235fd', '5', 'on'),
(86, '70e57235fd', '4', 'assasa'),
(87, 'fd7a623a9d', '1', 'IMAGE RESIXE'),
(88, 'fd7a623a9d', '2', '1'),
(89, 'fd7a623a9d', '3', 'NASN'),
(90, 'fd7a623a9d', '5', 'on'),
(91, 'fd7a623a9d', '4', 'SABIK'),
(92, 'fd81353461', '1', '11'),
(93, 'fd81353461', '2', '1'),
(94, 'fd81353461', '3', '1'),
(95, 'fd81353461', '5', 'on'),
(96, 'fd81353461', '4', '1111'),
(97, 'fd8762b7c2', '1', '11'),
(98, 'fd8762b7c2', '2', '1'),
(99, 'fd8762b7c2', '3', '1'),
(100, 'fd8762b7c2', '5', 'on'),
(101, 'fd8762b7c2', '4', '1111'),
(102, 'fd8f011e8a', '1', 'qq'),
(103, 'fd8f011e8a', '2', '0'),
(104, 'fd8f011e8a', '3', '11'),
(105, 'fd8f011e8a', '4', 'www'),
(106, 'fd9d60b084', '1', 'why do we use bindparam()?'),
(107, 'fd9d60b084', '2', '0'),
(108, 'fd9d60b084', '3', 'aaa'),
(109, 'fd9d60b084', '4', 's'),
(110, 'fda24d8327', '1', 'why do we use bindparam()?'),
(111, 'fda24d8327', '2', '0'),
(112, 'fda24d8327', '3', 'aaa'),
(113, 'fda24d8327', '4', 's'),
(114, 'fda8203702', '1', 'why do we use bindparam()?'),
(115, 'fda8203702', '2', '0'),
(116, 'fda8203702', '3', 'aaa'),
(117, 'fda8203702', '4', 's'),
(118, 'fda8ca38e1', '1', 'why do we use bindparam()?'),
(119, 'fda8ca38e1', '2', '0'),
(120, 'fda8ca38e1', '3', 'aaa'),
(121, 'fda8ca38e1', '4', 's'),
(122, 'fda97268c1', '1', ''),
(123, 'fda97268c1', '2', '0'),
(124, 'fda97268c1', '3', ''),
(125, 'fda97268c1', '4', ''),
(126, 'fdb5f4f569', '1', ''),
(127, 'fdb5f4f569', '2', '0'),
(128, 'fdb5f4f569', '3', ''),
(129, 'fdb5f4f569', '4', ''),
(130, 'fdbc31a522', '1', ''),
(131, 'fdbc31a522', '2', '0'),
(132, 'fdbc31a522', '3', ''),
(133, 'fdbc31a522', '4', ''),
(134, 'fdc85be575', '1', ''),
(135, 'fdc85be575', '2', '0'),
(136, 'fdc85be575', '3', 'aa'),
(137, 'fdc85be575', '4', ''),
(138, '0b4da6e344', '1', 'test'),
(139, '0b4da6e344', '2', '1'),
(140, '0b4da6e344', '3', '123'),
(141, '0b4da6e344', '5', 'on'),
(142, '0b4da6e344', '4', '12'),
(143, '0bb36c6c89', '1', 'MySql PDO not passing value from variable in php function'),
(144, '0bb36c6c89', '2', '1'),
(145, '0bb36c6c89', '3', '123'),
(146, '0bb36c6c89', '5', 'on'),
(147, '0bb36c6c89', '4', '123'),
(148, '0c00cd00d3', '1', 'aaa'),
(149, '0c00cd00d3', '2', '0'),
(150, '0c00cd00d3', '3', 'as'),
(151, '0c00cd00d3', '4', 'a'),
(152, '0c046278c6', '1', 'aaa'),
(153, '0c046278c6', '2', '0'),
(154, '0c046278c6', '3', 'a'),
(155, '0c046278c6', '4', 'a'),
(156, '0c0e4bf06b', '1', 'a'),
(157, '0c0e4bf06b', '2', '0'),
(158, '0c0e4bf06b', '3', 'a'),
(159, '0c0e4bf06b', '4', ''),
(160, '0c140b726b', '1', 'as'),
(161, '0c140b726b', '2', '0'),
(162, '0c140b726b', '3', '510'),
(163, '0c140b726b', '4', ''),
(164, '0f6e44804f', '1', 'a'),
(165, '0f6e44804f', '2', '1'),
(166, '0f6e44804f', '3', '1'),
(167, '0f6e44804f', '4', ''),
(168, '0f857cce9a', '1', 'q'),
(169, '0f857cce9a', '2', '0'),
(170, '0f857cce9a', '3', '123'),
(171, '0f857cce9a', '4', ''),
(172, '0ff41014f1', '1', '1'),
(173, '0ff41014f1', '2', '0'),
(174, '0ff41014f1', '3', '1'),
(175, '0ff41014f1', '4', ''),
(176, '101f76e659', '1', 'asdfg'),
(177, '101f76e659', '2', '0'),
(178, '101f76e659', '3', '1'),
(179, '101f76e659', '4', ''),
(180, '1026497b37', '1', '123'),
(181, '1026497b37', '2', '0'),
(182, '1026497b37', '3', '123'),
(183, '1026497b37', '4', ''),
(184, '15df6d4a01', '1', 'qwe'),
(185, '15df6d4a01', '2', '0'),
(186, '15df6d4a01', '3', '501'),
(187, '15df6d4a01', '4', ''),
(188, '15e2329fa0', '1', '123'),
(189, '15e2329fa0', '2', '0'),
(190, '15e2329fa0', '3', '123'),
(191, '15e2329fa0', '4', ''),
(192, '15e4e85639', '1', '123'),
(193, '15e4e85639', '2', '0'),
(194, '15e4e85639', '3', '123'),
(195, '15e4e85639', '4', '');
CREATE TABLE `adpostuser` (
`id` int(99) NOT NULL,
`adid` varchar(99) NOT NULL,
`userid` varchar(99) NOT NULL,
`posttime` datetime NOT NULL DEFAULT current_timestamp(),
`verif` varchar(9) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `adpostuser` (`id`, `adid`, `userid`, `posttime`, `verif`) VALUES
(1, 'a98e7e97e2', '1', '2019-08-31 21:57:27', '1'),
(2, 'ad129031b6', '1', '2019-09-01 01:57:29', '1'),
(3, '09b8369032', '1', '2019-09-17 14:38:27', '1'),
(4, '0906c4d03d', '2', '2019-09-18 00:44:53', '1'),
(5, '09120c53c7', '2', '2019-09-18 00:44:53', '1'),
(6, '7044c7a086', '1', '2019-10-04 14:35:24', '2'),
(7, '7065f93e14', '1', '2019-10-04 14:44:15', '2'),
(8, '70e57235fd', '1', '2019-10-04 15:18:15', '1'),
(9, 'fd7a623a9d', '1', '2019-11-04 13:47:50', '1'),
(10, 'fd81353461', '1', '2019-11-04 13:49:39', '1'),
(11, 'fd8762b7c2', '1', '2019-11-04 13:51:18', '1'),
(12, 'fd8f011e8a', '1', '2019-11-04 13:53:20', '1'),
(13, 'fd9d60b084', '1', '2019-11-04 13:57:10', '1'),
(14, 'fda1d5f5fd', '1', '2019-11-04 13:58:21', '1'),
(15, 'fda24d8327', '1', '2019-11-04 13:58:28', '1'),
(16, 'fda8203702', '1', '2019-11-04 14:00:02', '1'),
(17, 'fda8ca38e1', '1', '2019-11-04 14:00:12', '1'),
(18, 'fda97268c1', '1', '2019-11-04 14:00:23', '1'),
(19, 'fdb5f4f569', '1', '2019-11-04 14:03:43', '1'),
(20, 'fdbc31a522', '1', '2019-11-04 14:05:23', '1'),
(21, 'fdc85be575', '1', '2019-11-04 14:08:37', '1'),
(22, '0b4da6e344', '1', '2019-11-05 05:31:38', '1'),
(23, '0bb36c6c89', '1', '2019-11-05 05:58:46', '0'),
(24, '0c00cd00d3', '1', '2019-11-05 06:19:24', '0'),
(25, '0c046278c6', '1', '2019-11-05 06:20:22', '0'),
(26, '0c0e4bf06b', '1', '2019-11-05 06:23:00', '0'),
(27, '0c140b726b', '1', '2019-11-05 06:24:32', '0'),
(28, '0f6e44804f', '1', '2019-11-05 10:13:24', '0'),
(29, '0f857cce9a', '1', '2019-11-05 10:19:35', '0'),
(30, '0ff41014f1', '1', '2019-11-05 10:49:05', '0'),
(31, '101f76e659', '1', '2019-11-05 11:00:39', '0'),
(32, '1026497b37', '1', '2019-11-05 11:02:28', '0'),
(33, '15df6d4a01', '1', '2019-11-05 17:33:10', '0'),
(34, '15e2329fa0', '1', '2019-11-05 17:33:55', '0'),
(35, '15e4e85639', '1', '2019-11-05 17:34:38', '0');
CREATE TABLE `adproperty` (
`id` int(99) NOT NULL,
`property` varchar(99) NOT NULL,
`property2` varchar(99) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `adproperty` (`id`, `property`, `property2`) VALUES
(1, 'Title', 'title'),
(2, 'Type of Ad', 'typeofad'),
(3, 'Price', 'price'),
(4, 'Description', 'description'),
(5, 'Negotiable', 'negotiable');
CREATE TABLE `student` (
`stid` int(11) NOT NULL,
`fname` varchar(99) NOT NULL,
`lname` varchar(99) NOT NULL,
`gender` varchar(11) NOT NULL,
`email` varchar(99) NOT NULL,
`mob` varchar(99) NOT NULL,
`address` varchar(999) NOT NULL,
`uni` varchar(99) NOT NULL,
`uniid` varchar(99) NOT NULL,
`password` varchar(999) NOT NULL,
`city` varchar(99) NOT NULL,
`fb` varchar(99) NOT NULL,
`twitter` varchar(99) NOT NULL,
`linkedin` varchar(999) NOT NULL,
`about` varchar(99) NOT NULL,
`pro_pic` varchar(99) NOT NULL DEFAULT 'default.png',
`tespass` varchar(99) NOT NULL,
`code` varchar(99) NOT NULL,
`membersince` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `student` (`stid`, `fname`, `lname`, `gender`, `email`, `mob`, `address`, `uni`, `uniid`, `password`, `city`, `fb`, `twitter`, `linkedin`, `about`, `pro_pic`, `tespass`, `code`, `membersince`) VALUES
(1, 'aa111111ssssssss', '222ss', '', '1@h.com', '18226239935', 'cox bazafrhhh', '2', '1', '8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92', '', '', '', 'linkedin.com/1.h', '', 'default.png', '1', 'ahWHvPmIJnpw', '2019-09-15 03:09:51'),
(2, 'sabik', 'sabik', '', 'sab@gmai.com', '65789', '6789', '1', '', '6e7d04d2b700028a8f47464737a6257f9652f277e26ebe6c532f01d40f6ac8c8', '', '', '', '', '', '', '0', '', '2019-09-15 03:09:51'),
(3, 'sabikasdasd', 'qwerty', '', 'w@w.comaaza', '1', 'q2w23', '1', 'qwe', '8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92', 'sss', 'aaa', 'lk', '', 'sssaaqaaaaqw', 'default.png', '0', '', '2019-09-15 03:09:51'),
(4, 'sabik', 'sabik', '', 'b@gmail.com', '3456789', '567890', '1', '89', 'cd70bea023f752a0564abb6ed08d42c1440f2e33e29914e55e0be1595e24f45a', '', '', '', '', '', '', '0', '', '2019-09-15 03:09:51'),
(5, 'sabik', 'sabik', '', 'b2@gmail.com', '3456789', '567890', '1', '89', '8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92', '', '', '', '', '', '', '0', '', '2019-09-15 03:09:51'),
(6, 'sbaik', 'sanioasndoas', '', 'nasnd@gmail.com', 'knasldn', 'lkjsndflkndsa', '1', '123123123', '66e2beec7e35b80fc9a2c46d41caa10c63632ed1d76e31e731fc9a34cee7c566', '', '', '', '', '', '', '0', '', '2019-09-15 03:09:51'),
(7, 'Taeef', 'Najib', '', 'taeefnajib@gmail.com', '001937', 'defghjkl;', '2', '123456789', '8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92', '', '', '', '', '', '', '1', 'ahWHvPmIJnpw', '2019-09-15 03:09:51'),
(8, 'asif', 'imtiaz', 'm', 'asif@ghoorni.com', '01685726653', '', '1', '15126626', 'f0eee373417d6cee2d80f67483132ab44369c0ff115015a39745feba9dc736ac', '', '', '', '', '', '', '0', 'zTqbNEgmZCa7', '2019-11-05 05:16:30');
CREATE TABLE `students` (
`stid` int(11) NOT NULL,
`fname` varchar(99) NOT NULL,
`lname` varchar(99) NOT NULL,
`email` varchar(99) NOT NULL,
`mob` varchar(99) NOT NULL,
`address` varchar(999) NOT NULL,
`uni` varchar(99) NOT NULL,
`uniid` varchar(99) NOT NULL,
`password` varchar(999) NOT NULL,
`verif` varchar(99) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `uni` (
`id` int(99) NOT NULL,
`uniname` varchar(999) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `uni` (`id`, `uniname`) VALUES
(1, 'Ahsanullah University of Science and Technology'),
(2, 'NSU');
答案 5 :(得分:0)
.xls文件出现错误。在尝试了所有排列和组合之后,我将.xls文件转换为.xlsx并成功运行。
const Excel = require('exceljs/dist/es5');
const readExcel = async () => {
//You can use the absolute path also
let filepath = './genovaFile.xlsx';
let workbook = new Excel.Workbook();
await workbook.xlsx.readFile(filepath);
//You can use the index number also eg. 0 for selecting the sheet
let worksheet = workbook.getWorksheet("sheet1");
worksheet.eachRow({ includeEmpty: true }, async (row, rowNumber) => {
console.log("row " + row.values);
})
}