[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Need a quick one-liner



On Fri, Jul 04, 2003 at 01:51:34PM +0200, Joerg Johannes wrote:
> I have some data files in the following format:
> 
> 1	2	3	4
> 5	6	7	8
> 9	10	11	12
> 13	14	15	16
> ...
> 
> I need to sum up the second column, so the result is 32 (in this case).
> Any ideas?

awk '{ sum += $2 ; print sum }' foo | tail -1

-- 
Seneca
seneca-cunningham@rogers.com

Attachment: pgpRAYdLVhO9X.pgp
Description: PGP signature


Reply to: