Re: Q about the FasterCSV

James Edward G. II [mailto:[email protected]] :

What’s the correct way to handle:

one, “two”

? Is the second field two or “two” or “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 :slight_smile:

idea. I do know that it is invalid CSV though. :wink:

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

kind regards -botp

On 4/28/06, Peña, Botp [email protected] 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 :slight_smile:

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 forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs