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

Re: Need a quick one-liner



On Friday 04 July 2003 14:49, Seneca wrote:
> 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

Yeah, that's it! Thank you

joerg

-- 
Gib GATES keine Chance!



Reply to: