From 7e2a84681a4f6d08094f83c38be89ea4dab728ef Mon Sep 17 00:00:00 2001 From: "Denise D." Date: Tue, 28 Jul 2026 14:56:45 +0200 Subject: [PATCH] minor changes --- file.js | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/file.js b/file.js index 37c524f..1dde7fc 100644 --- a/file.js +++ b/file.js @@ -166,7 +166,8 @@ async function splitExcelFile(inputFile) { const worksheet = workbook.getWorksheet(1); const headerRow = worksheet.getRow(1).actualCellCount; //number of columns of the table - numRows = (worksheet.actualRowCount) - 1; + numRows = (worksheet.actualRowCount) - 1; // since it counts the row that represents the header, I need to subtract -1 + // to get the actual number of rows that contains the data worksheet.getRow(1) // to convert every title of the first row to upper case .eachCell((col, col_num) => { @@ -175,25 +176,6 @@ async function splitExcelFile(inputFile) { } }) - // convert every letter of CF to uppercase and store the CFs in the array cf - if (worksheet.getRow(1).getCell(6).value.trim() === 'CODICE FISCALE') { - worksheet.getColumn(6) - .eachCell((row, row_num) => { - row.value = (row.value).toString().toUpperCase(); - }) - } - - worksheet.getColumn(8) // of the first file - .eachCell((cell, rownumber) => { - if (typeof cell.value === 'string') { - cell.value = (cell.value).replace(/\b\w/g, char => char.toUpperCase()); - /* \b finds the start of a word (the boundary of a word) - \w targets the first letter following that boundary - /g (global flag) ensures it updates every word - */ - } - }) - // to store the names of the columns in columnNames worksheet.getRow(1).eachCell({ includeEmpty: true }, (cell, cell_num) => { columnNames.push(cell.value);