On Jan 5, 2009, at 1:17 AM, Tomasz Krakowski wrote:

> Parseping is working well, here is it:

I also believe you can simplify this code quite a bit.  I recommend  
this chunk of code:

>    a = a.split("\n")
>    len= a.length
>    for i in 0..len-1
>      if a[i] != nil
>        if a[i].match("Average") #search for line that matches text
>          aa=a[i]
>        else
>          next
>        end #if
>      else
>        next
>      end #if
>    end # for

with:

   aa = a.find { |line| line.include? "Average" }  # for Ruby 1.8

or:

   aa = a.lines.find { |line| line.include? "Average" }  # for Ruby 1.9

I believe it's 100% equivalent to what you are doing above.

James Edward Gray II