[ubuntu-us-mn] Scaling a number string in Sed?

Fred H Olson fholson at cohousing.org
Fri Feb 8 16:29:48 UTC 2013


On Thu, 7 Feb 2013, Tony Yarusso wrote:

> On Thu, Feb 7, 2013 at 12:59 PM, Fred H Olson <fholson at cohousing.org> wrote:
> > Anyone know whether Sed can be used to convert the last line of Wget
> > output (first line of exmple below) to something like the second line.
>
> No.  It can do the rearranging of parts, but not the math.

Thanks for confirming that, Fred.  The alternative approach that
I'd probably use is to do it with an editor macro.

> > That is to scale the KB/s to Mb/s (multiply by .008) ?
>
> Careful - you have two different things here.  There's a download
> speed in KB/s and a file size in MB - they are not both per second.

Actually I guess I did not communicate clearly.  I did want to modify
the output line to express the download speed two ways as
mega bits per second as well as kilo bytes per second.
The former is handy for comparison to other ways of measuring speed
that express the speed that as Mbps and communicating with /
comparison with my ISP that uses Mb/s  (Mbps).

I hope to study your code (some time) .

Fred

--
Fred H. Olson  Minneapolis,MN 55411  USA        (near north Mpls)
     Email:        fholson at cohousing.org      612-588-9532
My Link Pg: http://fholson.cohousing.org         My org:
Communications for Justice -- Free, superior listserv's w/o ads



More information about the ubuntu-us-mn mailing list