title: How can I skip the header row when reading a CSV in Ruby?
body: <p>Ruby's <a href="http://ruby-doc.org/stdlib-1.9.3/libdoc/csv/rdoc/CSV.html#method-c-foreach" rel="noreferrer"><code>CSV</code></a> class makes it pretty easy to iterate over each row:</p>
  
  <pre><code>CSV.foreach(file) { |row| puts row }
  </code></pre>
  
  <p>However, this always includes the header row, so I'll get as output:</p>
  
  <pre><code>header1, header2
  foo, bar
  baz, yak
  </code></pre>
  
  <p>I don't want the headers though. Now, when I call …</p>
  
  <pre><code>CSV.foreach(file, :headers =&gt; true)
  </code></pre>
  
  <p>I get this result:</p>
  
  <pre><code>#&lt;CSV::Row:0x10112e510
      @header_row = false,
      attr_reader :row = [
          [0] [
              [0] "header1",
              [1] "foo"
          ],
          [1] [
              [0] "header2",
              [1] "bar"
          ]
      ]
  &gt;
  </code></pre>
  
  <p>Of course, because the documentation says:</p>
  
  <blockquote>
    <p>This setting causes #shift to return rows as CSV::Row objects instead of Arrays</p>
  </blockquote>
  
  <p>But, <strong>how can I skip the header row, returning the row as a simple array?</strong> I don't want the complicated <code>CSV::Row</code> object to be returned.</p>
  
  <p>I definitely don't want to do this:</p>
  
  <pre><code>first = true
  CSV.foreach(file) do |row|
    if first
      puts row
      first = false
    else
      # code for other rows
    end
  end
  </code></pre>