# FasterCSV question: skip headers

**URL:** <https://www.ruby-forum.com/t/fastercsv-question-skip-headers/180152>\
**Category:** Ruby\
**Created:** [December 13, 2009, 1:24pm UTC](https://www.ruby-forum.com/t/fastercsv-question-skip-headers/180152 "2009-12-13T13:24:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![thiel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/3ab097/32.png) [@thiel](https://www.ruby-forum.com/u/thiel)\
**Post date:** [December 13, 2009, 1:24pm UTC](https://www.ruby-forum.com/t/fastercsv-question-skip-headers/180152/1 "2009-12-13T13:24:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![thiel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/3ab097/32.png) [@thiel](https://www.ruby-forum.com/u/thiel)\
**Post date:** [December 13, 2009, 4:50pm UTC](https://www.ruby-forum.com/t/fastercsv-question-skip-headers/180152/2 "2009-12-13T16:50:24Z")

</div>

On Dec 13, 2009, at 6:24 AM, Thiel C. wrote:

> 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 =\> 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 G. II

---

<div class="post-metadata">

**Author:** ![thiel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/3ab097/32.png) [@thiel](https://www.ruby-forum.com/u/thiel)\
**Post date:** [December 13, 2009, 5:44pm UTC](https://www.ruby-forum.com/t/fastercsv-question-skip-headers/180152/3 "2009-12-13T17:44:49Z")

</div>

Hi James,

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

Kind regards,

Thiel

James Edward G. II schreef:
