How to not import the headers of a text file

G

Guest

I'm trying to Import a test file into Access and I don't want the Headers or
Footers to be Imported.
 
R

Ron2005

A txt file is a txt file is a txt file. Access does not know any better
so all records/lines will be imported with perhaps the exception of the
very first row it you say it is the headers.

If there are multiple header rows and always that many header rows you
can
1) before you import, open it as input and rewrite the file to a new
file except for the first n records.
or
2) Import it and then run a query to eliminate the extra rows by
setting the criteria to something unique about them.

For the Trailer, the easiest will probably be:
1) import it and then run a query to eliminate the extra row by setting
the criteria to something unique about that row (s). Think of it this
way, if you can't determine anything unique about it, how can the
import porcess possiblely figure out what rows to import and what row
not to import.
2) import it then run an apend query to re-write all but the nth last
rows (the trailer rows) to a temporary table and go on from there.

Ron
 
B

Beth F.

In addition to Ron's suggestion, if you are willing to write code for
this, and do not want to modify your original file, see the last
posting by HSalim in thread:

http://groups.google.com/group/micr..._frm/thread/bb3850acce994ff2/a38cd653342fad5c

for code that uses existing import/export specifications. The code
allows you to specify a number of lines to skip at the top of your
input file. You could probably modify it to skip lines at the bottom
of the file as well.

HTH,
Beth F.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top