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

Filter an import

Status
Not open for further replies.

BrockLanders

Programmer
Dec 12, 2002
89
US
This is a reach, but is it possible to filter a file before importing or linking into a Access 2000 database.

I have a huge text file that I need to link or import into Access, but since the file is so big it's cumbersome to work with. I only need a few thousand of the millions of lines in the text file. If I could filter it so that only those few thousand lines were linked/imported then I'd be much better off.

Thanks in advance for any help!
 
If you don't want to have to deal with the long wait time, I'd recommend you hand-program some VBA that manually parses the text file--it reads everything in line by line, uses "Split()" to split each column into ... a column, then checks the line against your filter (assuming it's a pretty simple filter), then reprints the entire line in what I will call "file#2".

Then after you've parsed the entire original file, import file#2 directly into the database. This is all one-pass, and reading the file line-by-line will (probably) be as fast as any other method you can think of.

The only downside is that you actually have to manually program in the filter.
 
Is it possible to link to the file? If so, then link it and use an append query to extract the data you want and fill up the new table. When completed, delete the query and the link. All done.

[pc]

Graham
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top