title: How to find a specific row in csv
body: <p>I'm using ruby 1.9.2. My csv file as follows..,</p>
  
  <pre><code>NAME,    Id,   No,  Dept
  Tom,     1,    12,   CS
  Hendry,  2,    35,   EC
  Bahamas, 3,    21,   IT
  Frank,   4,    61,   EE
  </code></pre>
  
  <p>I want to print an specific row say ('Tom'). I tried out in many ways, but I didn't find the exact result. The most recommended options is "Fastercsv". But it is applicable for my version. Also, I noticed that csv print the field as column wise. How to print an entire row using csv in rails. My ruby code is as follows</p>
  
  <pre><code>require 'csv'
  
  csv_text = File.read('sampler.csv')
  csv = CSV.parse(csv_text, :headers =&gt; true)
  csv.each do |row|
   puts "#{row[:NAME]},#{row[:Id]},#{row[:No]},#{row[:Dept]}"
  end
  </code></pre>