How can I search for a file multiple times

I want to search for the same bulk of files in different folders and they are all located in a folder.
For example I want to search for a “File_name” in “folder_1”, “folder_2”, “folder_3” and tell me in which ones does it exist. “folder_1”, “folder_2”, “folder_3” are all located in a main folder. I want the results to be exported in an excel file and for each folder to have a column with the results of the search.

Hi

Welcome to uipath forum

Hope these steps would help you resolve this

  1. Use below command to get files in that directory and assign output to string array in a assign activity
     arr_files = Directory.GetFiles("Ur folder path") 
  1. check the length of the array. If length is greater than zero, then files exists in folder otherwise files not exists in folder like this

arr_files.Length >= 0

If true it goes to THEN part where you can confirm that the file is in this folder which you can update in excel file

Cheers @Mihai_Iancu

2 Likes

Hi,
Where should I write the " arr_files = Directory.GetFiles(“Ur folder path”) "command?

@Mihai_Iancu - are you trying in StudioX or Studio?

If Studio please change the your post category to that because it is currently posted under StudioX…

I am trying in StudioX

@Mihai_Iancu - Sorry for the delayed response…Are you looking something like this??

I have 3 folder under the MasterFolder…

image

And one of the folder contains the file i am searching for…

image

Since I have checked “Include sub-folders”, it will search all the folders under MasterFolder and look for the file name contains “736”…

Hope this helps…

yes, but the same file can be found in more than 1 folder.

Simply place the file in all the folders and you will get the result…