From: Cs Webgrl on 1 Jul 2010 16:15 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 1 Jul 2010 16:22 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
|
Pages: 1 Prev: Running a shell command from ruby Next: Handling File.open exceptions |