Link to home
Start Free TrialLog in
Avatar of vbnetcoder
vbnetcoder

asked on

ignore first row in the import

I am creating an import spec for a pipe deliminated file.  How would i ignore the first row?
Avatar of Jeffrey Coachman
Jeffrey Coachman
Flag of United States of America image

There is an option in the wizard that says "First Row Contains Field names"

...Make sure that is unchecked
To be clear

Sometimes the first row will be the field names, and the second row will start the data...

In most cases you can say that the first row contains fiedd manes and the NEW imported table will have the filed names.

If you are appending records to an existing table, make sure the field names are the same, and you can still select "First Row contains field names", ...and again, the field names will still be the correct field names in the table, ...but only the data (in effect ignoring the field names) will be imported.

Jeff
sorry for the poor spelling:

Sometimes the first row will be the field names, and the second row will start the data...

In most cases you can say that the "first row contains field names" and the NEW imported table will have the field names correct and the data will start normally (Row, 1 in the table)

If you are appending records to an existing table, make sure the field names are the same, and you can still select "First Row contains field names", ...and again, the field names will still be the correct field names in the table, ...but only the additional data (in effect ignoring the field names) will be imported.

So when you say "row 1" remember that Row 1 in the text file is not the same as Row 1 in the table...

Jeff
There is no way to ignore rows.  As Jeff mentioned, you have the option of specifying that the first row contains column headings or not.  If what you are trying to ignore is some "header" produced by another application, there is no way to exclude it.  You have to import it and hopefully you can identify it and delete it later.  If the header is formatted such that it causes an error on import, you might get lucky and Access will never add it to your table.
I believe that if you import an excel file, you can specify a range to import if you use the docmd.transferspreadsheet function. here's a simple example
http://access.mvps.org/access/general/gen0008.htm

So you could start the range at the row you want, and skip those you want to skip.
Avatar of vbnetcoder
vbnetcoder

ASKER

My issue is that the file the customer sends over does not contain a header row it just has stuff in it that i don't need.  The file is .csv
ASKER CERTIFIED SOLUTION
Avatar of PatHartman
PatHartman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
1. Import as is and delete the extra row after the fact.

This would be my best option as long as it doesn't error out when it gets imported
Let us know if that works for you.
will get back to this
ty