From: Gregory Mazurek Date: 2009-10-13T04:32:09+09:00 Subject: Re: remove specific text from line --001485f6d2f017d28d0475c1fcea Content-Type: text/plain; charset=ISO-8859-1 On Mon, Oct 12, 2009 at 3:27 PM, Collin Moore wrote: > Hi > thanks for all the help on my previous question, but now I am trying to > clean up the output of some text output. > > currently I have: > Time@110.075: EVENT: [LOG] *** DEBUG ACTION *** > > and I'd like it to have: > 110.075:DEBUG ACTION > > : just for easy import into excel. > > Here is the current ruby file I am working with where is looked for > lines with DEBUG and START in them. > > File.open('output.txt', 'w') do |f2| > File.readlines("original.txt").each do |line| > if line =~ /DEBUG/ || line =~ /START/ > f2.puts line > end > end > end > > Any ideas? > > thanks for your help :) > -- > Posted via http://www.ruby-forum.com/. > > why don't you gsub('Time@', '').gsub(' EVENT: [LOG] *** ', '').gsub(' ***', '') Greg -- www.abetaday.com --001485f6d2f017d28d0475c1fcea--