title: Create a Hash from a CSV-like file
body: <p>I have a products file listing the item #, products, and price. I would like to read this file and initialize it as a hash with the item #'s being the key and the products and price being the value. Here is my file</p>
  
  <pre class="lang-none prettyprint-override"><code>199, Shoes, 59.99
  211, Shirts, 19.99
  245, Hats, 25.99
  689, Coats, 99.99
  712, Beanies, 6.99
  </code></pre>
  
  <p>I would like it to look like this.</p>
  
  <pre><code>products = {
    199 =&gt;['Shoes', 59.99],
    211 =&gt;['Shirts', 19.99],
    245 =&gt;['Hats', 25.99],
    689 =&gt; ['Coats', 99.99],
    712 =&gt; ['Beanies', 6.99]
  }
  </code></pre>
  
  <p>This is what i could come up with which is not really what it want.</p>
  
  <pre><code>products_file = File.open("files.txt")
  products_hash = []
  while ! products_file.eof?
    product_hash = products_file.gets.chomp
    print product_hash.split(', ')
  end
  </code></pre>
  
  <p>And here is the output that I came up with:</p>
  
  <pre><code>["199", "Shoes", "59.99"]
  ["211", "Shirts", "19.99"]
  ["245", "Hats", "25.99"]
  ["689", "Coats", "99.99"]
  ["712", "Beanies", "6.99"]
  </code></pre>