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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

looking for patterns in a variable string

Status
Not open for further replies.
Feb 12, 2003
45
US
Hi all,
Thought I'd seek the support of the 'boards'. I'm trying to determine before importing a file if one of 3 predefined strings exist in the file name being imported (ie. 121204_us.txt - I'm looking to _check_ for the existence of 'us' or two others). Anyone have a simple way to do this?
Many thanks in advance,
Chris
 
Hi!

Think from versions 2000 at least, the InStr function is available, so for instance:

[tt]if InStr(sFileName,"us")>0 then
msgbox "us exists within"
end if[/tt]

Roy-Vidar
 
Thanks very much... I've gotta get a good command ref manual - I've got a couple of how-to guides, but that's really basic command reference stuff... Thanks much Roy
Chris
 
My pleasure, and as an aid in your search, here's a thread on book recommandations, "all levels", also links to further threads (thread702-793040).

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top