Import lots of CSV

G

Guest

I need to import lots of csv autometically. all the csv will be stored in one
location. the csv name format will be "date_location_incremental-Number".
every 1 hour new csv file will be pushed in that location. i need to import
those csv in one table and store the imported csv name in another table so
that it will not import the same csv twice. csv data will be append. and
before import any csv it will check the file name stored table. can any one
give me a sample VBA script or help me?
 
J

Jeff Boyce

You've already defined "how" (data here, csv_name there).

Would it be possible to append the csv data AND an identifier to a single
table?

Could you use a unique index on the fields to ensure no duplicate data is
appended?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
G

Guest

Thanks for your help. but i didn't understand your answer. can you please
explain in details. duplicate data can be append but i want to stop duplicate
CSV to append. i need to append all the csv data in one table.
 
J

Jeff Boyce

Let's try an example...

You have a CSV file named "20070410.txt", with one record, three values:
"ABCD", "4/1/2007", 123.

You link to (or import) that file, then append a record to your permanent
table ... you append:
"ABCD", #4/1/2007#, 123, "20070410.txt"
into
TextField, DateField, NumberField, FileNameField

Now, if you want to be sure not to re-load anything from the CSV file
20070410.txt, just check to see whether you have any records in your
permanent table with that in the FileNameField.

Or am I still missing something?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
G

Guest

The conventional solution to your problem is to add code that moves your
files into an archive directory after reading in. That way, they are no
longer seen by the import program.
 

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

Top