Import Multiple .csv to a single table

gripper

Board Regular
Joined
Oct 29, 2002
Messages
176
Hello Board Members
I was hoping to solicit some help with an import issue. In fact I am trying to end a tedious task.

I have a folder located at c:\raw_keywords\access_import that contains many (100’s) of .csv files. This file will be static. I copy files into this folder for the single purpose of loading into Access. When I am done I move these out. It is just a staging area.

I wish to load and append all files in this directory to “tblKeyword”. Each file is the same format and the exact same column titles. There are 4 columns this is constant.

I have created a form named “Keyword Import” and on that form I have a command button named “cmdMassLoad”. I would like to simply click this and have it load all records into this table.

Optionally, I would like to date stamp each record and also have the file name it came from. For instance if the file path is “c:\raw_keywords\access_import\business 1” then I would like it condensed to just “business 1” ( I do not need the file path but just the individual file name).

The end result will be Column 1 (Autonumber Index) - Column 2 “Date” – Column 3 “File Name” - Column 4 “Keyword” – Column 5 “comp” – column 6 “Global” – Column 7 “Local”
Again these last 4 columns are identical names as each .csv. This table is already set up.

I appreciate any assistance you can render

Thanks
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

Forum statistics

Threads
1,224,561
Messages
6,179,521
Members
452,923
Latest member
JackiG

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top