Import csv file to excel

Hi, I have file CSV 3 files and template excel file 1 file

sample file CSV
num|“DATE”|“abc”|“def”|“fgh”|“sec”|“ry”|“rty”|“ryt”|“qwe”|“asd”|“zxc”|“yhu”|"fvb’|“oly”|
123|SDA312|123.1|123.11|2022-06-09|0|bb 12|“adasd”|“sdf”||2023-08-“14”|0.000000|984.399700|||

Requirement as below.

  • combine data (CSV) 3 file (sepe with no header
  • copy data to templete excel to sheet Ori row3
  • Apply formar row2 to all row
  • delete row2

Please guide me for solve it.
Thank you

Hello @Stef_99,

First read all three CSV files in UiPath using the ‘Read CSV’ activity with the delimiter set to | and IncludeColumnNames set to False, then merge them into a single DataTable using the Merge DataTable activity. Next, open your template Excel file and write the combined data into the “Ori” sheet starting from cell A3 using the Write Range activity. Once the data is written, copy the formatting from row 2 of the template by selecting it as the source range and pasting formats onto the entire data range below using the Copy Paste Range activity with the paste option set to “Formats.” After applying the formatting, delete row 2 using the Delete Rows activity to keep only the data with proper formatting applied. Finally, save the Excel file, and you will have all three CSV files combined, correctly formatted, and stored in the template.

1 Like

@Stef_99

read csv and use merge datatable

then write range to write the data

auto fill range activity to drag formula

you dont need to delete row 2 instead srtie from row 2 as the formula are in different columns it would not effect

cheers

1 Like

@sagar.singh1 How to apply format row2 to another rows?

Use ‘Select Range’ to select ‘Row 2’ (e.g., "A2:Z2").

1 Like

Hi @Stef_99

use read csv activity for each file with “add headers” unchecked, merge data tables using merge datatable activity, use excel application scope to open template file, use write range starting at cell a3 to write merged data, use copy range to copy formatting from row 2 and paste it to data rows, then use delete range activity to delete row 2.

Happy Automation

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.