I'm trying to get the data from a given column from excel in nodejs (for example, column "Emails"), work with the data and then export the result in the same excel, in a new column named "Emails-Result".
This is what I tried by fetching the data:
const xlsx = require('xlsx');
const emails = [];
var workbook = xlsx.readFile(`./view/assets/uploads/${filename}`);
var first_sheet_name = workbook.SheetNames[0];
var address_of_cell = 'Emails';
var worksheet = workbook.Sheets[first_sheet_name];
var desired_cell = worksheet[address_of_cell];
emails.push(desired_cell.v);
console.log(emails);
but I get this error:
TypeError: Cannot read property 'v' of undefined
so the data couldn't be retrieved.
Also, how can I make a new column (if not exists) and add the result in it?
Any ideas, please?