LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] Re: perl file processing

[ILUG] Re: perl file processing

Marcus Furlong furlongm at hotmail.com
Thu Oct 9 02:30:01 IST 2008


Francis Daly <francisdaly <at> gmail.com> writes:

> More idle curiosity, which might be interesting -- were the calculated
> averages equivalent?
> 
> > The sed/awk one comes out with the following:
> > real    0m32.733s
> > user    0m10.915s
> > sys     0m11.838s
> >
> > whereas the pure awk one is a lot faster:
> > real    0m18.239s
> > user    0m2.035s
> > sys     0m2.761s
> >
> > Ran a few times just in case, and those times are fairly consistent. Anyway
> > thanks to you both!
> 
> On those numbers, it should take about a minute to find out.
> 
> Replace "," with ";print" each time in the END block of my awk, and
> you should get two sets of output which are easily diff'able.
> 
> For presentation, you might also like to set OFMT="%.3g" before
> printing -- that limits the number of printed significant figures. Or
> use "f" for decimal places, depending on the input range.

I had already changed this to use printf "%f %f %f %f %f %f\n" which seemed to
do what I wanted.

I got a fright there for a while because some sets of averages didn't match up
at all. It turns out there were more characters than [a-zA-Z] for some class
descriptions. Once that was fixed, yes, both sets of figures are identical.

Marcus.





More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell