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

No members online now.

Forum statistics

Threads
474,470
Messages
2,571,809
Members
48,797
Latest member
PeterSimpson
Top