Well you seem to have quite a few changes in there. Have you looked into 
regular expressions? That might be enough to match a pattern and make 
your changes.
http://rubular.com/

Without multiple examples and the rules laid out clearly it'd be 
difficult to write something flexible enough to cover a repetitive task.

I'd start out with something like
output = 
input.gsub("#{input.match(/[\d:\s]{60,}/).to_s.strip}","(#{input.match(/[\d:\s]{60,}/).to_s.strip})")

That'd add the parentheses where you seem to want them, assuming your 
number sequence is identical in each line as in your example. You should 
be able to use variations on this kind of approach for the rest of the 
changes.

Maybe someone else will come up with a more efficient method :)

-- 
Posted via http://www.ruby-forum.com/.