title: Tab delimited file parsing in Rails
body: <p>I have a file that looks like this</p>
  
  <pre><code>ID Name  Car
  1  Mike  Honda
  2  Adam  Jim
  </code></pre>
  
  <p>These values are tab delimited, and from this I want to parse it in Ruby and put it into my database. </p>
  
  <p>I have tried the following</p>
  
  <pre><code>require 'csv'
  
  CSV.foreach("public/files/example.tab", {:col_sep =&gt; "\t"}) do |row|
    @stuff = row[0]
  end
  </code></pre>
  
  <p>but <code>@stuff</code> just returns the whole entire object, and doesn't seem to be using the column separator I specified.</p>
  
  <p>It also does not take into account that the first row is a header.</p>
  
  <p>How can I parse a tab delimited file in Ruby and how do I tell it that the first row is a header?</p>