From: "Thomas B." Date: 2008-09-02T17:17:38+09:00 Subject: Re: inline double quotes John Dax wrote: > hi, > i'm searching for a way to remove inline double quotes in ruby, > especially in a csv file. > > sth like "blabla "title" blbl";"bla bla" should become > "blabla 'title' blbl";"bla bla" > > thanks in advance > johnny Your csv is malformed if it has such quotes, so there is no standard way to remove them. You'll have to use some regular expression, for example if all the columns in your file are quoted, and t is a line from your file, try this: t.split(/^"|";"|"$/)[1..-1].map{|e| "\"#{e.gsub(/"/,"'")}\""}.join(";") Probably not the easiest method, but certainly a one-liner. TPR. -- Posted via http://www.ruby-forum.com/.