How to loop into two arrays same time?

Hello everybody,

I need to copy the content of 24 excel files to an other 24 excel files.

So the idea is to use read range and write range. But the issue is i will have to make like 12 read activities and 12 writes activities.

So, i figured! i would use an array for each of the files.

So the idea, is that i get all the 12 files names and all the 12 names of the other files. both saved on diffrent variables as arrays. Than i use for each to iterate on the 12 first files to read each one of them, and iterate on the same time on the 12 others, so they can save the content of each one them simultaneously.

One other issue, is that i have to copy the data from a specif file to an other specific file, which i know both names for all the 24 excel files.

This is an example, trying to fix it.

TEST.xaml (8.5 KB)

Any ideas on how to proceed please?

I excuse for my bad english :slight_smile:

Hi @mz3bel,

Not sure if this what you want but give it a try.
TEST.xaml (7.5 KB)

Cheers :upside_down_face:

1 Like

Yes, that’s what i was looking for! Thank you @YAZIDI

But noticed a problem with the name let me check it that and get back to u please!

1 Like

@YAZIDI

So my idea worked well, but i encourted a problem. Each one of the 12 excel files i copy the data from has to be past to an other from the other 12 excel files. But the thing is that each one has to be copied to a specific one! At first i though since they are on windows i can use only arrays, copy and past easly. But now i have to find a way so that each one the files can be copied to the right one… I hope u do unterstand!

Do u have any idea? i mean add a switch inside the loop or condition ?

Thanks in advance !!!

Cheers :slight_smile:

@mz3bel

You can sort the second list of files and make it correspondent to the first list files without changing the loop. Tell me if this helps

Ta7ya l RPA :crazy_face:

1 Like

@YAZIDI

I can’t sort them, i mean each one have a specific name. there’s no way to sort them. Unless i use there names?

Hahaha :smile:

@mz3bel

Is there something you can use to indentify the second file name using the first file name?

@YAZIDI

No nothing only by names, i’m obliged to pass the names khoya :smiley:

Are the names dynamic or static?

Static names for now

How about making a Config.xlsx file with all the names in it, and then use it in one loop?
and whenever you want to modify, add, delete, you easily do it from the Config File

1 Like

Suure, how can i do it please? or do u have any example ?

There you go: TEST.xaml (6.1 KB) Config.xlsx (7.4 KB)

1 Like

@YAZIDI

Thanks a lot :smiley:

1 Like

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