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

Look for a substring

Status
Not open for further replies.

patyavila

Technical User
Apr 29, 2004
28
0
0
US
I'm taking data from text files using a variable=ImportFileName found through a FileSearch that looks for *.txt on a directory. Run TransferText to import data and even though they are "import errors" every time (the field types are set in such way to descriminate data that doesn't has the correct format), I need to automatically erase the ImportErrors table as the user will never use it and it willkeep growing endlessly as the source name is not the same.
The problem is the ImportFileName gives me the full path while the ImportErrors table is created using only the filename. Do anyone know how to select only the last part of the variable so I can add "_ImportErrors" to the variable and get the table name?
Thank you very much for your interest and help
Patricia
 
Take a look at something like this:
MsgBox Dir(ImportFileName)
or
strBaseName = Dir(ImportFileName)
MsgBox Left(strBaseName, Len(strBaseName) - 4)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top