Forum: Ruby Re: Q about the FasterCSV

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
6087a044557d6b59ab52e7dd20f94da8?d=identicon&s=25 Peña, Botp (Guest)
on 2006-04-28 06:36
(Received via mailing list)
James Edward Gray II [mailto:james@grayproductions.net] :

# What's the correct way to handle:
#
# one, "two"
#
# ?  Is the second field two or "two" or <space>"two".  I have no

imho, the latter. computer just reads what is in between. no bias. no
loss of any data. (though "correct" may not be a good term here since
the input is not defined for strictly normal csvs)

btw, we also have semicolon and tab separated values here. same behavior
except it's just semicolons or tabs that delimits. It would be nice if
fastercsv can handle varying delimiters as well. just a thought. maybe,
we can name it faster-delimiter :)

# idea.  I do know that it is invalid CSV though.  ;)

you've been really been helpful. thank you for your time.

kind regards -botp
31e038e4e9330f6c75ccfd1fca8010ee?d=identicon&s=25 Gregory Brown (Guest)
on 2006-04-28 07:25
(Received via mailing list)
On 4/28/06, Peña, Botp <botp@delmonte-phil.com> wrote:

> btw, we also have semicolon and tab separated values here. same behavior except it's 
just semicolons or tabs that delimits. It would be nice if fastercsv can handle varying 
delimiters as well. just a thought. maybe, we can name it faster-delimiter :)

I think both CSV and FasterCSV can do this.  Same rules apply though,
just different delimiters.

In FasterCSV, it looks like this:

irb(main):007:0> FasterCSV.parse("a\tb\tc\n", :col_sep => "\t")
=> [["a", "b", "c"]]


In CSV, this:

irb(main):010:0> CSV.parse("a\tb\tc", "\t")
=> [["a", "b", "c"]]
This topic is locked and can not be replied to.