From: Charles Calvert Date: 2010-10-27T00:45:14+09:00 Subject: Re: CSV parsing with optional spaces between fields On Thu, 5 May 2005 22:45:54 +0900, Gergely Kontra 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. -- Charles Calvert Moderator - alt.computer.consultants.moderated Submission Address: accm@celticwolf.net Contact Address: accm_mod@celticwolf.net