Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.ruby > #6935

Empty quote char in FasterCSV

Newsgroups comp.lang.ruby
Date 2014-03-19 04:57 -0700
Message-ID <6b7782d2-d135-4e0d-8b63-a67d7bb16fa5@googlegroups.com> (permalink)
Subject Empty quote char in FasterCSV
From Romiras <romeeras@gmail.com>

Show all headers | View raw


I have to generate a file with values separated with semicolon. There are empty values for which "" is unwanted.

For example, this code
FasterCSV.generate({:col_sep => ";"}) { |csv| csv << ["another", "", "row"] }

generates the following output:
another;"";row

As you see, "" is unwanted in output. The wanted output is
another;;row


I tried to accomplish it using :quote_char with the following code:
FasterCSV.generate({:col_sep => ";", :quote_char=>""}) { |csv| csv << ["another", "", "row"] }

Is there a way to omit empty ""?

Back to comp.lang.ruby | Previous | NextNext in thread | Find similar


Thread

Empty quote char in FasterCSV Romiras <romeeras@gmail.com> - 2014-03-19 04:57 -0700
  Re: Empty quote char in FasterCSV Michael Uplawski <michael.uplawski@uplawski.eu> - 2014-03-19 16:10 +0100
    Re: Empty quote char in FasterCSV Romiras <romeeras@gmail.com> - 2014-03-20 05:55 -0700

csiph-web