title: Not able to place csv data in a Hash
body: <p>I have a CSV file with two columns:</p>
  
  <pre><code>PPS_Id Amount
  123    100
  1234   150
  </code></pre>
  
  <p>I read data from this file and insert in a array using the code below:</p>
  
  <pre><code>CSV.foreach("filename.CSV", headers: true) do |row|
    file_details &lt;&lt; row.inspect # hash
  end
  </code></pre>
  
  <p>I am then trying to push the data in the <code>file_details</code> into a hash with <code>PPS_Id</code> as key and <code>Amount</code> as Value, I am using the code below:</p>
  
  <pre><code>file_details_hash = Hash.new
  
  file_details.each { |x|  
    file_details_hash[x['PPS_Id']] = x['Amount']
  }
  </code></pre>
  
  <p>But when I print the result I get nothing just <code>{"PPS_Id"=&gt;"Amount"}</code></p>
  
  <p>Can you please help</p>