[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