From: Sean Clark Date: 2006-05-06T01:48:58+09:00 Subject: CSV::IllegalFormatError (Need to club data entry person) I'm using csv module to read parse 76,000 rows of patient data in a CSV file. I use the below line to read in the file and loop through the rows. CSV.open("patientfile.txt", "r") do |row| When I get to a row like below the script blows up: /usr/local/lib/ruby/1.8/csv.rb:639:in `get_row': CSV::IllegalFormatError (CSV::IllegalFormatError) from /usr/local/lib/ruby/1.8/csv.rb:556:in `each' from /usr/local/lib/ruby/1.8/csv.rb:531:in `parse' from /usr/local/lib/ruby/1.8/csv.rb:311:in `open_reader' from /usr/local/lib/ruby/1.8/csv.rb:85:in `open' from sync.rb:1 The row is similar to below. Note the embedded "B" within the address field. "M1234567","John","A","Doe","321 NORTH "B" ST","","Sometown","ST","55555" Is there a way to get around this error and escape the "B" properly before opening the file in CSV.open, or would I be better to just flag this record and move on? -- Posted via http://www.ruby-forum.com/.