Forums | Admin

Discussion Forums: help

Start New Thread Start New Thread
Message: 91731
BY: James Gray (bbazzarrakk)
DATE: 2009-11-24 20:17
SUBJECT: RE: Unquoted fields do not allow \r or \n

 

FasterCSV columns exactly as you described them:

#!/usr/bin/env ruby -wKU

require "rubygems"
require "faster_csv"

p FCSV.parse(DATA.read)

__END__
21,43,"Note:
blah this is a note",xyz,pdq

The third column was placed into one String, including the newline.

I did remove the spaces after your commas. I hope they aren't in the real data. If they are though, you could probably use :col_sep => ", " (note the space after the comma) instead.

Hope that helps.


Thread View

Thread Author Date
Unquoted fields do not allow \r or \nJoe Cairns2009-11-24 16:14
      RE: Unquoted fields do not allow \r or \nJames Gray2009-11-24 19:38
            RE: Unquoted fields do not allow \r or \nJoe Cairns2009-11-24 20:01
                  RE: Unquoted fields do not allow \r or \nJames Gray2009-11-24 20:17

Post a followup to this message