FasterCSV - write tab delimited files

  • Follow


Hi,

I'm using FasterCSV to write out a tab delimited file.  For empty
fields, does anyone know if there's a way to not put in empty quotes
("") for nil or blank fields?

Thanks
-- 
Posted via http://www.ruby-forum.com/.

0
Reply Cs 7/1/2010 8:15:19 PM

On Jul 1, 2010, at 3:15 PM, Cs Webgrl wrote:

> I'm using FasterCSV to write out a tab delimited file.  For empty
> fields, does anyone know if there's a way to not put in empty quotes
> ("") for nil or blank fields?

The behavior you describe, not quoting empty fields, is the default for =
FasterCSV:

>> require "rubygems"
=3D> true
>> require "faster_csv"
=3D> true
>> FCSV.generate(:col_sep =3D> "\t") { |csv| csv << [1, 2, nil, 4] }
=3D> "1\t2\t\t4\n"

James Edward Gray II=

0
Reply James 7/1/2010 8:22:27 PM


1 Replies
873 Views

(page loaded in 0.08 seconds)

Similiar Articles:













7/18/2012 11:17:53 AM


Reply: