Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need help with regexp relating to a file name

Status
Not open for further replies.
Apr 27, 2006
126
GB
Hi,

I have a bunch of reports generated on a daily basis, they output in the basic format of the following:

NameOfReport_YYYY-MM-DD-hh-mm-ss.xls

I will be running some script at which point I will prompt for a date... which is fine.. so I can build the contents of a variable to contain everything up to "NameOfReport_YYYY-MM-DD-" but after that I'm stuck as the hours, minutes and seconds are, as far as I'm concernet, random elements.

so when I try to workbooks.open(filename) I am missing the latter half of the filename.

I expect that regular expressions will be the sensible way forward but I have never used them, looking at the basic expressions they kinda make sense but I wouldn't know where to start in using one in this situation (and I expect I have gone down the totally wrong road in generating the filename the way I did rather than loading a list of files into an array)

Help :)

________
clueless
 
Have a look at the Dir function.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 



"I will be running some script at which point I will prompt for a date"

Check out the GetOpenFileName method.

Skip,

[glasses] When a diminutive clarvoyant had disappeared from detention, headlines read...
Small Medium at Large[tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top