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
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
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”
=> truerequire “faster_csv”
=> trueFCSV.generate(:col_sep => “\t”) { |csv| csv << [1, 2, nil, 4] }
=> “1\t2\t\t4\n”
James Edward G. II
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs