Hi rubyists,
has anyone some code to parse data from a text file, like semicolon
seperated data for example?
I would love read it to see how you implement a text parser in the ruby way
to make my own the right way
In my case I have to parse a CSV saved by Open Office. The fields that
contain strings are enclosed by double quotesâŚ
The CSV Module from RAA fails with a IllegalFormat ExceptionâŚ
thanks!
Dominik
Hi, Dominik
From: âDominik Werderâ dwerder@gmx.net
Sent: Wednesday, June 25, 2003 9:21 PM
has anyone some code to parse data from a text file, like semicolon
seperated data for example?
$ ruby18-preview3 -rcsv -e âp CSV.parse_line(%Q(âabcâ;âdefâ), ?;)â
[âabcâ, âdefâ]
CSV module should be able to parse SSV formatted text.
Regards,
// NaHi
Might be better to help debug the CSV module, as per Joel Spolskyâs
observation that old code accumulates corner cases, and when you start
from scratch you lose the benefit of that painful accumulation. If the
RAA module has test suite, a few lines from your OO file might make a
valuable addition to it.
martin
¡¡¡
Dominik Werder dwerder@gmx.net wrote:
I would love read it to see how you implement a text parser in the ruby way
to make my own the right way
In my case I have to parse a CSV saved by Open Office. The fields that
contain strings are enclosed by double quotesâŚ
The CSV Module from RAA fails with a IllegalFormat ExceptionâŚ