Importing CSV file with header row

tho28199

Registered User.
Local time
Today, 16:49
Joined
Jan 25, 2007
Messages
28
Is there a way to automatically skip row 1 of a CSV file when importing? Row 1 contains a header with filename, date created, period covered, total record count, etc., and then Row 2 contains the column names.
 
Part of the Import Text Wizard allows you to tick a small box that declares the First Row Contains Field Names ... that's what you need to do.
 
Unfortunately, that does not do it... as I explained, the 1st row does not contain the field names... they are in the 2nd row. The 1st row contains header information (filename, date created, period covered, total record count, etc.).

I need a way to eliminate the 1st row completely or for Access to ignore the 1st row and use the field names from the 2nd row.
 
delete it from the csv file before the import!

you would get exactly the same result if you tried to import the csv into excel.

"Data" is expected to be logical AND consistently formateed, and a random text row (as far as access/excel is concerned) is meaningless
 
I was looking for an automated way of doing that, so the user can simply receive the source csv file, and import it into the database without manual manipulation.

The alternative is to go back to the source and have them remove the header, but that comes at a $ cost, which I was trying to avoid.
 
well the other way is for you to strip out the header row in code

but that means opening the file - reading and writing out every row other than the first row - thereby achieveing the desired result.

probably worth checking the format of the row, in case it really is a data row - or deleting rows that don;t have the deisred format.
 

Users who are viewing this thread

Back
Top Bottom