title: Ruby Read CSV and pick out variables
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/4369039/best-way-to-read-csv-in-ruby-fastercsv">Best way to read CSV in Ruby. FasterCSV?</a>  </p>
  </blockquote>
  
  
  
  <p>Is it possible to have Ruby read through a CSV file, line by line and use the contents of the line to set as different variables?</p>
  
  <p>e.g. one line is <code>Matt,Masters,18-04-1993</code> and I want to split the line and use:</p>
  
  <ul>
  <li>Matt = firstname</li>
  <li>Masters = surname </li>
  <li>18-04-1993 = dob</li>
  </ul>
  
  <p>so far I have:</p>
  
  <pre><code>require 'uri/http'
  require 'csv'
  
  File.open("filename.csv").readlines.each do |line|
  
  d = line.split(",")
  
  puts d
  
  end
  </code></pre>