To search Date format file

Locate the excel file where the name of the file contains current month and current year in the format YYYY and MM. The naming convention of the file does not matter as long as it has current month and current year. For example, if current month and current year is February 2023, the automation would look for the file that has ‘02’ and ‘2023’ in the name of the file. For example, the automation could pick up any of the files with the following naming conventions ‘2023.02’, ‘2023-02 ’, ‘02.2023’, ‘02-2023’, ‘02.2023 ’. Then, open that file.

Hey @Sayed_Tabrez1 ,

Have a look at the shared solution.
ForumSolution.xaml (11.5 KB)

Thanks,
Sanjit

Hey @Sayed_Tabrez1 ,

The same can be accomplished with regular expressions. You can obtain the month starting from 1 to 12 and the year, or vice versa, by using the regular expression below.

System.Text.RegularExpressions.Regex.IsMatch(currentItem.ToString,“([0-9][1-2])\S\d{4}”) or System.Text.RegularExpressions.Regex.IsMatch(currentItem.ToString,“\d{4}\S([0-9][1-2])”)

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.