ignore first row in the import

I am creating an import spec for a pipe deliminated file.  How would i ignore the first row?
vbnetcoderAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jeffrey CoachmanMIS LiasonCommented:
There is an option in the wizard that says "First Row Contains Field names"

...Make sure that is unchecked
0
Jeffrey CoachmanMIS LiasonCommented:
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
0
Jeffrey CoachmanMIS LiasonCommented:
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
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

PatHartmanCommented:
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.
0
Andy CownieImplementation SpecialistCommented:
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.
0
vbnetcoderAuthor Commented:
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
0
PatHartmanCommented:
Then, your options are:
1. Import as is and delete the extra row after the fact.
2. Open the csv with notepad prior to importing and delete the row.
3. Read the .csv as a text file, row by row.  This gives you complete control of how you want to process each record.

I'm sure there are others that will be suggested.  #1 would be my choice if the extra record is easily identifiable AND it will not cause the importing of the rest of the data to be a problem.  For example,  If the extra row contains a text string but the first column of the normal data would be numeric, this would cause Access to interpret the first column as a string.  So, I would NOT use this method.
#3 is my second choice.  This code loop is not difficult and you would also add a code loop to loop through the columns of each row so you can add the data to specific columns.  You will need to include error handling to trap any data errors.
#2 is really feasible only if this is a one time import.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
vbnetcoderAuthor Commented:
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
0
PatHartmanCommented:
Let us know if that works for you.
0
vbnetcoderAuthor Commented:
will get back to this
0
vbnetcoderAuthor Commented:
ty
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.