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

Francis Daly francisdaly at gmail.com
Thu Oct 9 00:35:22 IST 2008


2008/10/8 Marcus Furlong <furlongm at hotmail.com>:
> I ran both yours and Francis' from a shell script over the 250 files,
> and out of curiosity, I checked the times for each.

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.

Cheers,

f



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