From: Sam Duncan Date: 2012-06-27T15:23:26+09:00 Subject: Re: CSV.open problem, help please On 06/27/2012 06:14 PM, Kaye Ng wrote: > This code doesn't seem to work > > require 'csv' > CSV.open('text.txt', 'r').each do |person| > puts person.inspect > end > > ----------------------------------------------------------- > >> ruby "database.rb" > C:/Ruby192/lib/ruby/1.9.1/csv.rb:1892:in `block (2 levels) in shift': > Unquoted fields do not allow \r or \n (line 1). (CSV::MalformedCSVError) > from C:/Ruby192/lib/ruby/1.9.1/csv.rb:1863:in `each' > from C:/Ruby192/lib/ruby/1.9.1/csv.rb:1863:in `block in shift' > from C:/Ruby192/lib/ruby/1.9.1/csv.rb:1825:in `loop' > from C:/Ruby192/lib/ruby/1.9.1/csv.rb:1825:in `shift' > from C:/Ruby192/lib/ruby/1.9.1/csv.rb:1767:in `each' > from database.rb:2:in `
' >> Exit code: 1 > Help please! > What does your csv file look like? Sam