From: Robert Dober Date: 2007-01-13T02:35:04+09:00 Subject: Re: DRY gsub... ------=_Part_45769_4522708.1168623301349 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 1/12/07, Josselin wrote: > > I wrote the following ruby statements.. I get the result I need , I > tried to DRY it for 2 hours without being successfull , > > d = d.gsub(/\r\n/,' ') # get rid of carriage return > d = d.gsub(/;/,' ') # replace column by space > d = d.gsub(/,/,' ') # replace comma by space > a = d.split(' ') # split into component , space as divider > > tfyl > > Joss I know you got lots of answers but what about a = d.gsub(/;|,/," ").split If I am not mistaken it will work on Unix too. HTH Robert -- "The best way to predict the future is to invent it." - Alan Kay ------=_Part_45769_4522708.1168623301349--