PDA

View Full Version : Import CSV and Append



bjoshi
02-21-2013, 07:18 AM
Hi,

I need help importing data into an access table from multiple csv files.

All csv files have the same columns 'Name', 'Address'.
The access table has 3 columns, 'Type', 'Name', 'Address'.

Here's what I want to do.
(1) Loop through all the csv files located at 'c:\MyCSVdata\'
(2) Get the 1st csv file and import data from the 2nd line to the end of file, update/append it to the table 'MyTable' in the database 'TrialDatabase'.
(3) If the filename is 'Test.csv' and it contains 10 rows, then the 'Type' column in 'MyTable' should contain the value 'Test' for the 10 rows imported from this s=csv file.
(4) Repeat 2 and 3 over and over again till all csv files are appended to the table 'MyTable'.

I dont know if this is possible, but any help is appreciated.

Regards,
bjoshi