Get Specific File Data from Folders,Subfolders



I am trying to extract data from file/s which contains a specific word “MemberRef”

These files are present in subfolders of main folder like


Is there a way where I can search a specific string “Member Ref” in a directory “\user1\Documents\2016” and search the root folders to get the list of all file names and extract data?

How to get the count of number of files and folders present in a main folder


You can use Directory.EnumerateFiles - example attached.
Command in your case would be similar to:
Directory.EnumerateFiles("\user1\Documents\2016", "*MemberRef*.xlsx", SearchOption.AllDirectories)

FindFilesTest.xaml (6.1 KB)


How to set task in UIPath? need help

Thanks Andrzej,

I have used another line of code which yields similar results.


Many Thanks! :slight_smile:

closed #4