FasterCSV question: skip headers

T

Thiel Chang

Hi ,

I am refactoring a class that's using Fastercsv to read a csv file. How
do I skip the first (header) line. Now I'm using a helpvariable skipHEADER
but I want a more elegant solution .

Kind regards,

Thiel
 
J

James Edward Gray II

I am refactoring a class that's using Fastercsv to read a csv file. =
How do I skip the first (header) line. Now I'm using a helpvariable =
skipHEADER but I want a more elegant solution .

If I understand the question correctly, I would recommend setting =
:headers =3D> true as a FasterCSV option. This will cause it to read =
the headers in the first row, but not return them. You can then refer =
to columns by name, instead of by number.

Hope that helps.

James Edward Gray II=
 
T

Thiel Chang

Hi James,

Thanks for your response. I tried the header option. It worked,.

Kind regards,

Thiel


James Edward Gray II schreef:
 

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

Members online

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,737
Latest member
Georgeengab

Latest Threads

Top