My goal here is to read an xlsx file in, add a row, and output it. Simple enough right?
This is the code I have so far:
var filename1="input.xlsx";
var filename2="output.xlsx";
var Excel = require('exceljs');
var workbook = new Excel.Workbook();
workbook.xlsx.readFile(filename1);
workbook.getWorksheet("Sheet 1").addRow([1,2,3]);
workbook.xlsx.writeFile(filename2);
I believe this should read that data from "input.xlsx," write a row in addition to the data already on the sheet, and output it. Instead of copying the file, it creates an empty "output.xlsx."
I know I'm doing something stupid, also I'm totally new to nodeJS. Any thoughts?