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?
Microsoft Access

Avatar of undefined
Last Comment
vbnetcoder

8/22/2022 - Mon
Jeffrey Coachman

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

...Make sure that is unchecked
Jeffrey Coachman

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
Jeffrey Coachman

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
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
PatHartman

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.
Andy Cownie

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.
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
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
ASKER CERTIFIED SOLUTION
PatHartman

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
vbnetcoder

ASKER
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
PatHartman

Let us know if that works for you.
vbnetcoder

ASKER
will get back to this
Your help has saved me hundreds of hours of internet surfing.
fblack61
vbnetcoder

ASKER
ty