I have a method that watches a folder and checks if a file exists. Once the file exists, some code will execute handling the file.
The file name has the form DailyReport_MMddyyyy_[some sequence of numbers].xlsm
. The MMddyyyy
part is a date in that form (so i.e. 08132014 for 08/13/2014), and the sequence of numbers has to do with the time the report is generated and is unimportant for my purposes. This report is generated once a day, so the part of the file name that I'm interested in is up to the MMddyyyy part.
Is there a way to indicate "variable" characters in a string? I.e. var filename = "DailyReport_" + DateTime.Now.ToString("MMddyyyy") + "[something to indiciate any variable number of characters]"
? Right now I am using File.Exists(filePath)
to check if the file exists every few minutes with Quartz scheduler.