Importing Many Files

  • Thread starter Thread starter Craig
  • Start date Start date
C

Craig

I have to manipulate and convert many data files, on a daily basis, coming
in from many different sources. The files and the fields are rarely the
same.

The main thing I want to be able to do is import every file as "Text" only
into its own table. Is there some way to set up a command to do this
without going through the text import wizard for each file.

Thanks
Craig
 
Hi Craig,

If all the data files are regular CSV files, just use

DoCmd.TransferText acImportDelim

with no import specification.

For files with any other format, if you don't want to use the text
import wizard you'll need to write code that parses the file to identify
the fields so it can be imported. The main routes are then (a) use the
field information to create a schema.ini file which TransferText can
use, or (b) have your code read the file, parse each line and append the
corresponding record to the Access table.

If you're having to manipulate a lot of text files, IMHO it's worth
learning to use the free specialist text file tools such as Perl
(http://www.activestate.com/products/activeperl/) and the Unix textutils
(Windows versions are at http://unxutils.sourceforge.net/).
 
So can a schema.ini file be created to import into a new table, or is it
only for existing tables

Craig
 
Back
Top