[SWLUG] adding up columns

Ian Hill I.A.Hill at cs.cardiff.ac.uk
Sat Dec 13 13:40:33 UTC 2003


[Repost - I think the original was dropped]

Bryn,

There is no need to keep track of the keys. My GNU AWK will let me use:
	
	{
		data[$1] = $2
	}

	END {
		for (val in data)
			print val "," data
	}

This does the same thing I think...

Ian

-- 
Ian Hill
I.A.Hill at cs.cf.ac.uk

Humans are communications junkies.  We just can't get enough.
		-- Alan Kay




More information about the Swlug mailing list