How to Append file excel 2 sheet?

I want to append file excel all file in folder.

If I have 2 File in folder , I want to append 2file but first sheet with first sheet and second sheet with second sheet.
Book1.xlsx (8.7 KB)
Book2.xlsx (8.7 KB)
output.xlsx (8.8 KB)

Please guide me about it.

@fairymemay,

You can read both excel and you will get two different datatables.
take write range, provide path of excel in which u want to append, give sheet names as per your names like first sheet & second sheet.

Hi @fairymemay ,

Here is an activity called “Merge / Append Sheet ByRow” from “BalaReva.EasyExcel.Activities”.

Regards
Balamurugan.S

@Pankaj.Patil Please guide activity or example flow to me?

@fairymemay - Please try like this…

Hope this helps…

Update: Apologize…I missed the Read Range before …

@prasath17 From your flow. I think it append all sheet all file to new file one sheet.

I want first sheet (file1) append with first sheet (file2) ---->write in outputfile3
and second sheet (file1) append with second sheet (file2)----> write in outputfile3 and write it new sheet.

@fairymemay - No it will not…Please give it a try (you are just guessing right)…I have already ran the sample workflow…and it is working fine…

@fairymemay - Please wait…you case seems to be different where the Output.xlsx already exist…let me retry…

1 Like

@fairymemay - Why the sheet names in book1 and book2 are different??? it should be same right??

@prasath17 Yes,Sheet name are different.

Could you map sheet with first sheet in book1 and first sheet in book2 ,
second sheet in book1 and second sheet in book2 ?

Thank you for your support.

@fairymemay - I will give it a try today …

One question: Are you allowed to Use BalaReva activities in your organizatio?

@prasath17 yes, I​ can​ use​ it.

@fairymemay - Have you tried as @balupad14 showed?

@prasath17 I​ don’t​ know​ how​ to​ apply​ balareva in​ this​ case.

Please​ guide​ me​ about​ it.

hi @Hiba_B - When you get a chance , could you please take a look this query from @fairymemay …?

2 Likes

Sure, I am starting to develop a WF suggestion :grinning_face_with_smiling_eyes:

2 Likes

Here is my suggestion: Append_sheets_with_order.xaml (11.8 KB)
I did not use Balareva activities.
Before running the WF, be sure to modify the argument to that it fits your folder_path:


And let us know if it does not work properly !
Also don’t forget to remove the “*end” and the end of your excel files :wink:

1 Like

@Hiba_B - Looks like your idea is similar is fine(please see my post above), you have used index and i have used file.exists…But her case looks different I guess based on the workbook @fairymemay provided…

Another downside of this approach(both yours and mine) is AppendRange on the sheet 2 won’t write the headers… :wink: :yum:

@fairymemay - Could you please provide the correct sheet names for your cases , both book 1 and book2 ?

1 Like

Well by using the index I specify if I want the headers or not, and at the end I get the headers:


Actually:
when i read only the first file (so when I have index = 0), I use write range with add headers.
Once the first file is read, I only use append range for the next files.
→ that way I don’t have to worry about the headers
→ I have 2 index (one is index_of_sheets, the other one is index of file)

2 Likes

@Hiba_B - Got it …I have missed to notice the two indexes… :frowning_face:

2 Likes