Merge many CSV files of different names in folder


I have many CSV files with different names in a folder(named Excel_Files) and I would like the bot to merge all these files in an Excel sheet named “Output”.

All the CSV files have the same number of columns and have the same column names.

I did this:

Can someone help me continue please?

Note: I created the variable fileslist of datatype “Array of String”

@NIVED_NAMBIAR Can you help me please?

@Yudhisteer_Chintaram1 - Please try like this…

In the If loop…it will look for output.csv exists…first time file wont be available so it goes write csv and creates the file with headers…second time it goes to append csv and appending rest of files …

Hope this helps…

Note: Change the path in the For Each loop, as per your requirement…

1 Like

It works. But I didn’t notice before. I have an excel among it. Can you tell me how to transform all to CSV or Excel before merging them?

1 Like

@Yudhisteer_Chintaram1 - Yes…that is doable…Here you go…

My Input files


My Output


Last two rows came from excel file. so it works…

Note: Read Range Output should be saved to datatable called “Dt”…same one we used in CSV.

Hi @Yudhisteer_Chintaram1 - Did you get a chance to try ? if it worked, please mark my post as solution , that will close the thread and others will benefit from it(finding solved posts).

Sorry I didn’t notice your solution.

Can you send me the xaml file please?

is “path” a variable here?

@Yudhisteer_Chintaram1 - sure… will share the xaml after sometime.

Path.getextension is a method…

Here you go: (45.3 KB)

Run this workflow as is, you will get the output.csv gets created in the project folder…

1 Like

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