#! /usr/bin/perl while(<>) { if(/(\d+) bytes received in .+ seconds \(([0-9.]+) bytes/) { $size = $1; $bps = $2; printf "%d %.2f\n", $size / 1024, $bps / 1024; } }