# FasterCSV - write tab delimited files

**URL:** <https://www.ruby-forum.com/t/fastercsv-write-tab-delimited-files/190983>\
**Category:** Ruby\
**Created:** [July 1, 2010, 10:15pm UTC](https://www.ruby-forum.com/t/fastercsv-write-tab-delimited-files/190983 "2010-07-01T22:15:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cswebgrl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/edb3f5/32.png) [@cswebgrl](https://www.ruby-forum.com/u/cswebgrl)\
**Post date:** [July 1, 2010, 10:15pm UTC](https://www.ruby-forum.com/t/fastercsv-write-tab-delimited-files/190983/1 "2010-07-01T22:15:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![cswebgrl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/edb3f5/32.png) [@cswebgrl](https://www.ruby-forum.com/u/cswebgrl)\
**Post date:** [July 1, 2010, 10:23pm UTC](https://www.ruby-forum.com/t/fastercsv-write-tab-delimited-files/190983/2 "2010-07-01T22:23:01Z")

</div>

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 G. II
