From: Joel Pearson Date: 2012-09-04T21:33:44+09:00 Subject: Re: need help to get output I'm not as good at Ruby notation, but does this modification do what you want? member,slot,outputstring="","","" File.readlines(ARGV[0]).each do |linecrlf| line = linecrlf.chomp case line when /^member/ then member=line when /^Slot/ then slot=line when /Memory utilization/ outputstring = "#{outputstring}#{member} #{slot} #{line}\n" end end puts outputstring.gsub(/:/,"").gsub(/\s+percent/,"") -- Posted via http://www.ruby-forum.com/.