FasterCSV not working

HI,

I don’t know why :
FasterCSV.foreach(filename) do |line|
puts “1234”
end

prints nothing but filename has some data and moreover its not giving
any error, I checked it using begin-rescue-end statement. :frowning:

What version of Ruby are you using? I think in 1.9 FasterCSV is just
CSV. This works for me in 1.9.3:

require ‘csv’

read a file line by line

CSV.foreach(“purchase.csv”) do |line|
puts line[0]
end

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs