Match string wthin files names

please I need ur help, i have a string “name” i have to check within a list of excel file in a directory if a file contain this string. (do some job) and when there is no match i have to create a new excel file named “name”.

Thank you in advance


Check below for your reference

You can place a IF condition and use Create File activity to create the file

Hope this helps you


You can just pass “name” to an excel application scope. Make sure to check the ‘create new’ property and it will open the file if it exists, or it will create it if it doesn’t exist



readin the files from directory with filtering to xlsx extensions:
Directory.GetFiles(“D:_Workplace\work_projects\UIPath-Projects\uipath_forum\Users\ifranity”, “*.xlsx”)

checking if a filename exists with the SearchTerm in its FileName:
arrFiles.Any(Function (x) Path.GetFileNameWithoutExtension(x).Contains(SearchTerm))

If not exists then create the file as @Dave mentioned

Find starter help here:
ifranity.xaml (5.9 KB)