Importing Text File

  • Thread starter Thread starter martin
  • Start date Start date
M

martin

On a daily basis, I am wanting to import a text file (the
original has an unrecognized extension, I am renaming it
with a '.txt').
This is a comma delimited file. If done manually I can do
it without a problem.
After the text file has been imported, I run a query,
creating a new table that has eliminated the unnecessary
fields.
This new table will be exported to Excel.

My problem is in trying to reduce the manual tasks and
save a template, where the fields are named and given
properties.
 
suggest you import the text file manually first. in the Import Wizard, click
the Advanced button to refine your setup and save it as an Import
Specification. one of the refinements you can make is to "skip" fields you
don't want. that way you won't have to use that make-table query later to
eliminate unwanted fields. (btw, you don't need to use a make-table query in
any event; you can just create a Select query to pull the data/fields you
want and export the query to Excel.) after saving your Import Specification,
allow the Import Wizard to create the table at import.

once the Import Specification and table have been created, you can run
future imports of text files with the same format via VBA or a macro.

hth
 
I would build a macro to import the file then have the
macro run a query to delete fields, then have it call
another marco to export to Excel.
 
Back
Top