Convert CSV Files to Excel (xlsx format) in Power Automate
Автор: Graciela @ Power GI
Загружено: 2021-11-30
Просмотров: 86395
Learn how to leverage Power Automate's out of the box actions & Office Scripts to convert CSV documents into Excel (xlsx).
Check out this video ( • Read Raw Excel Data (unformatted xlsx) usi... ) if your source file is in XLSX format instead of CSV.
Code for the Office Script:
[starts]----------------------------------------------
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");
}
[ends]----------------------------------------------
Follow the steps in this link if you don't see the "Automate" tab:
https://docs.microsoft.com/en-us/micr....
Please note that Office scripts will time out if you have more than 1000 rows to insert.
Questions? We can help! Contact us a graciela@powergi.net
Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: