[SWLUG] adding up columns
Bryn Reeves
hagbard at nildram.co.uk
Sat Dec 13 12:53:29 UTC 2003
On 10:09 Sat 13 Dec , Dick Porter wrote:
> On Fri, 2003-12-12 at 21:41, Bryn Reeves wrote:
> > You can do this with sed & awk, it takes about 30s on my PIV celeron to
> > process a 60Mb file. Just put the script in a file & make it executable:
>
> You can lose the cat and sed parts by setting the field separator to ','
> and letting awk open the files itself:
>
> awk -F, "$AWK_SUM" $@
>
> - Dick
>
>
Ah! Thanks for that - I had a feeling you could do something like that,
guess I should have rtfm ;) That cuts it down to about 12s for the 60MB
file, lots quicker.
Cheers
Bryn
More information about the Swlug
mailing list