perl -pe' s!\d{4,}(?=\s)! sprintf$"x($x=-4+length$&) ."%3.*f" .qw(M G T)[$x/3], $x%3<1, $&/1024**int$x/3+1 !ge '