Importing CSV File

G

Guest

Does anyone know if there is a special way to import a CSV file starting from
a specific row. I have CSV files and the first row is header information. The
file info doesn't actually start until the second row. I know I can write a
MODULE to do the task but is there an import specification I can use?

Cheers, Marty
 
K

Ken Snell \(MVP\)

No, import specification cannot do this for you per se -- but if you tell
the specification that the first row is header information, it'll use that
row as the field names. This may or may not be what you want to achieve,
though -- if not, then

(1) you could open the text file in VBA and rewrite it to a new text file
(skipping the first row) and then import that new file;

(2) or you could import the entire text file to a temporary table and then
use append query to filter out the "first row" (you'd need to know how you
could identify this row after the data are in the temp table) to copy the
data to the permanent table;

(3) or you could open the text file in VBA and read each line one at a time
and write (via recordset) to the permanent table, and skip the first row.
 
G

Guest

The field names start in row 2; row 1 just has some meaningless stuff in it.
I will probably wite a VB program that eliminates the first line then imports
the body as a recordset.

Cheers, Marty
 
G

Guest

This is exactly what I was looking for. I want to thank you for taking the
time to answer this question. This is going to save me so much time in the
future.

Cheers, Marty
 

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