Match string wthin files names

Hello,
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

@ifranity

Check below for your reference
https://forum.uipath.com/t/tutorial-how-to-check-a-string-is-present-in-excel-sheet-part-1/243696/2

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

Hope this helps you

Thanks

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

@ifranity


grafik

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)