From: Dick Davies Date: 2004-06-09T19:57:22+09:00 Subject: Re: strip DOS ^Ms? * Robert Klemme [0624 11:24]: > > "Dick Davies" schrieb im Newsbeitrag > news:20040609094700.GA21180@lb.tenfour... > > > > Me again. I have chosen one of the crappiest websites on Gods > > green Earth to scrape here.... > > > > For no good reason I have buttloads of '^M's all over the file > > when I check it in vi. What would I feed gsub to strip them out? > > Otherwise I'm looking at a very very long regex to yank out the > > fields I need.... > > while ( line = gets ) > line.chomp! > p line # no more \r\n at end > end They're not at end of line though, they're just scattered through the lines... and vi/dos2unix isn't an option , I'm doing this on a string on its way from the webserver to REXML... -- It is better never to have been born. But who among us has such luck? One in a million, perhaps. Rasputin :: Jack of All Trades - Master of Nuns