Hello,
I have a problem with huge CSV file, which I am trying to convert to Excel spreadsheet. The problem is that the script works only for CSV files below 10,000 rows. My input CSV file has approximately 85,000 rows and it is different every day. Can you please let me know how to divide the CSV file in Power Automate into smaller files which I can then convert to Excel? And then what is the possibility to merge small spreadsheets into one 85,000 rows spreadsheet? The script that I am using:
function main(workbook: ExcelScript.Workbook, lineCSV: string[]) {
let selectedSheet = workbook.getActiveWorksheet();
const alllines = lineCSV;
let counter = 1;
for (let line of alllines) {
if (line.includes(",")) {
let items = line.split(",");
selectedSheet.getRange("A" + counter+":G"+counter).setValues([[items[0], items[1], items[2], items[3], items[4], items[5], items[6]]]);
counter++;
}
}
workbook.addTable(selectedSheet.getRange("A1:G" + counter), true).setName("ContactInfo");
}
Thank you
Agnes