Hey Dan,
Create an import spec and then use DoCmd.TransferText. The spec will allow
you to specify the data types and sizes and columns and you can then use it
in on all of the similar input files in the applicable TransferText
argument. This action will overwrite the previous table each time so if
you've got something worth saving be sure to move it to another table.
If you know the names of all of the imput files in advance and they are the
same every time I suppose you could fill a table with the file names, loop
through the list, and execute the TransferText each time through with each
input file name as one of the arguements OR there's probably a way to read
the file names directly from your sub-directory and skip the table.
Definitely have to do the latter if the names of your input files change but
I couldn't tell you how to read all of the names of files in a
sub-directory. Perhaps someone else knows how to do this or can suggest
another approach that will work better.
Mike
"Dan" <danmat347 (AT) hotmail (DOT) com> wrote
Quote:
Could someone please offer me some help on this:
I am new to Access and trying to figure out how to automate data
import from a science software. The science software outputs about a
hundred SEPARATE flat text data files for each run. The flat text
data files have the same fields and rows for each file.
I have created an Access table with the same fields that are present
in the data files. How can i automate the process of importing the
hundred or so data files with their respective fields into the Access
table's fileds. Since there are about a hundred of these flat text
data file tables, naturally i'd like the process to be automated.
Any guidance would be apprecited. Thanks
- Dan M. |