From: ciapecki Date: 2008-03-19T19:24:52+09:00 Subject: Re: regexp conditional On 19 Mrz., 10:09, Xavier Noria wrote: > My interpretation of what you need is: > > input = '111|"aaaa" bbbbb|c' > > fields = input.split('|') > fields[1].gsub!('"', '""') > fields[1] = %Q{"#{fields[1]}"} > > output = fields.join('|') > > Depending on the input that may not be valid, for example if fields[1] > may contain a pipe. Anyway being a mal-formed input assumptions depend > on the actual data. > > -- fxn your solution works, and thanks for that, I am waiting though for a regexp solution, thanks anyway chris