Importing csv file where do not know the full filename?

Help.Chris

Registered User.
Local time
Today, 06:43
Joined
Oct 11, 2000
Messages
43
Hi all,

I need to import several files with a really daft naming convention. An example of one of these is
CDR_URW_05_NTS_20030815_20030815_001417_0000000687.new

These files are csv files, i know the filename and path and can predict the filename upto the CDR_URW_05_NTS_20030815 which is unique to each file. I do not know the file name after this point.

I am hoping to automatically import these files into the database during the night before the user uses the database.

Does anyone know how i can get access to look in the folder for the first 23 characters, and the pick the rest itself. If i can do this, i am thinking i can have the full filename as a variable to use with the import command and its import spec.

Thanks for the help in advance, i am really clueless how i can go about doing this.

Chris
 
Look into the dir command.... or dunk below code into a sub and see how it works...
Code:
Dim myfile as string
Dim mydir as string
mydir = "C:\"
myfile = dir(mydir & "CDR_URW_05_NTS_20030815*.*")
do untill myfile = ""
    debug.pring myfile
    myfile = dir
loop[code]
Regards

The Mailman
 
Thanks!! That worked!!

Thank you.

That worked, is great! Is much appreciated!

Chris
 

Users who are viewing this thread

Back
Top Bottom