Selecting a different file for each Do While loop

Hello Robot masters, I’m a complete newbie and trying to create a process that selects excel files from a folder one by one during a loop until none left. And I need to get a unique or the next file each loop. How do I go about this? I used Directory.GetFiles to get an Array of strings, the Do While process is fine, I just need to pick a different file every time it loops.

Hi @daqc

Welcome to UiPath Community!

You are in very right direction, Directory.GetFiles() will give you an array of files after this assign statement you can use a foreach loop and iterate on each file by using read range

image

Thanks,
Prankur

1 Like

Thanks for the reply! So I used For each but what if my folder has dozens of files, do I have to manually iterate on each file with read range?

1 Like

No, it’s a loop it will pick one file after another automatically.

1 Like

Thanks! I will get back to you on if it works :grinning:

1 Like

Sure, let me know if it does not, I will help you.

1 Like