Only import certain records form a CSV file

  • Thread starter Thread starter Thornhill
  • Start date Start date
T

Thornhill

I have a 2.2 GB CSV file. Every time I try to import it I get the jet
engine error, which I assume is because the file is so large. The file
is essentially a massive statewide address book and I only need
records from one city (which represents about 20% of the file). So, is
there a way to import just records from that one city?

Thanks.
 
Hi.
So, is
there a way to import just records from that one city?

With a query, yes. Try the following syntax for a make table query from the
CSV file:

SELECT StAddr, Street, City, State, ZIP INTO tblAddresses
FROM [TEXT;HDR=YES;DATABASE=F:\Work\Test\].Addresses.csv
WHERE (City = 'Los Angeles')
ORDER BY Street, StAddr

Replace the names of the columns, table, path, and file with your own. If
the columns aren't named in the file, change HDR=YES to HDR=NO.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blog: http://DataDevilDog.BlogSpot.com
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact
info.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top