From: Cs Webgrl on
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/.

From: James Edward Gray II on
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"
=> true
>> require "faster_csv"
=> true
>> FCSV.generate(:col_sep => "\t") { |csv| csv << [1, 2, nil, 4] }
=> "1\t2\t\t4\n"

James Edward Gray II