CSV parsing with optional spaces between fields

Hi!

I'd like to parse a CVS file, which can contain whitespaces between
fields, but it seems, that the csv.rb in ruby 1.8.2 doesn't support
this. What can I do?

thx in advance
Gergo

···

--
+-[ Gergely Kontra <kgergely@mcl.hu> http://www.mcl.hu/~kgergely ]------+

PhD Student (Room:IB113) PGP ID: 0x7E3846BF Mobile:(+36 20)356 9656 |
Budapest University of Technology and Economics ICQ# 175564914 |

+------------- "Olyan langesz vagyok, hogy poroltoval kellene jarnom!" -+

----- End forwarded message -----

--
+-[ Gergely Kontra <kgergely@mcl.hu> http://www.mcl.hu/~kgergely ]------+

PhD Student (Room:IB113) PGP ID: 0x7E3846BF Mobile:(+36 20)356 9656 |
Budapest University of Technology and Economics ICQ# 175564914 |

+------------- "Olyan langesz vagyok, hogy poroltoval kellene jarnom!" -+

wrote in <20050505134532.GA17414@mlabdial.hit.bme.hu>:

I'd like to parse a CVS file, which can contain whitespaces between
fields, but it seems, that the csv.rb in ruby 1.8.2 doesn't support
this. What can I do?

Just in case someone stumbles across this in the Google archive, here
is the deal:

If the field is surrounded by quotation marks, any spaces outside
those quotation marks would be considered malformed.

If the field is not surrounded by quotation marks, then the space is
considered part of the field's content. If you don't want it, look at
String#strip and its cousins.

···

On Thu, 5 May 2005 22:45:54 +0900, Gergely Kontra <kgergely@mcl.hu>
--
Charles Calvert
Moderator - alt.computer.consultants.moderated
Submission Address: accm@celticwolf.net
Contact Address: accm_mod@celticwolf.net