Convert CSV Files to Excel (xlsx format) in Power Automate

Опубликовано: 30 Ноябрь 2021
на канале: Power GI
64,621
367

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...  ) 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 [email protected]


Смотрите видео Convert CSV Files to Excel (xlsx format) in Power Automate онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Power GI 30 Ноябрь 2021, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 64,621 раз и оно понравилось 367 людям.