Filter text file before Import

mims

Registered User.
Local time
Today, 05:58
Joined
Jul 30, 2011
Messages
10
Hi,

I am writing some VBA script to import a text file into Access. However, the text file is very large, so I would only like to import the records between a specified date.

Is there any way that i can specify a date range and only import the relevant records from a text file?

Thanks for your help!
 
Using VBA you can read the textfile and write the records you want to import to a different textfile. When you're done, import the created textfile.

Don't know if that's faster than importing the complete textfile and deleting the records you don't need. It requires less programming though.

HTH:D
 
You can probably use the Command Prompt's FindStr function to get the contents of the file that match a certain date. You will need to know some pattern matching to get your match. Then pipe the results to a new temporary file, and finally import the contents of the temp file into your db.

VBA Shell() will allow you run FindStr()
 

Users who are viewing this thread

Back
Top Bottom