B
bbxx789_05ss
$ cat data.csv
name number
me 12
you 20
require 'rubygems'
require 'fastercsv'
FasterCSV.foreach("data.csv", :headers =>true, :col_sep =>'\t') do |row|
puts row
puts row['name']
puts row['number']
puts row.class
end
--output:--
me 12
nil
nil
FasterCSV::Row
you 20
nil
nil
FasterCSV::Row
I've sifted through the docs, and I can't find any indication why the
row['name'] syntax won't work.
name number
me 12
you 20
require 'rubygems'
require 'fastercsv'
FasterCSV.foreach("data.csv", :headers =>true, :col_sep =>'\t') do |row|
puts row
puts row['name']
puts row['number']
puts row.class
end
--output:--
me 12
nil
nil
FasterCSV::Row
you 20
nil
nil
FasterCSV::Row
I've sifted through the docs, and I can't find any indication why the
row['name'] syntax won't work.