Csv to hash

Thanks Simon. No matter what I do I get nil.

txt = File::read("batches.conf")
ary = txt.scan(/^([^,\n]+),([^,\n]+)­/)
h = {}
ary.each {|k,v| h[k] = v }
puts h[10001]

=> nil