Accessing specific files from sub folders

,
I am trying to access pdf and html files from a sub folders through a main folder.
I need to access only pdf files of name “Service Details” in it and html files of name “Service Request”.
In my requirement i need to compare these two files from a sub folder.

Can anyone please suggest me

did you try like this
arrayVariable = Directory.GetFiles(“yourFolderPath”,“*.pdf”)

https://go.uipath.com/component/directory-subdirectory-file-search
you can try this!

1 Like

Fine
This expression will help you resolve this
arr_files = Directory.GetFiles(“yourfolderpath”,”.”,SearchOptions.AllDirectories).AsEnumerable().Select(Function(a) a.ToString.Contains(“Service Requests”) AND a.ToString.Contains(“Service Details”)).ToArray()

Cheers @saneeth_kandukuri

1 Like