I'm trying to add a column of numbers which contain commas in a file called countries.txt; i.e, 123,456. The numbers are in the 2nd column of the file. The general structure of the command is:
awk '(tot+=$2); END {print "Total = " tot} countries.txt
When I execute this all I get is the sum of the numbers prior to the first comma. I know that I have to either parse the numbers or somehow get rid of the commas.
Can anyone tell me how to do this. Thanks.
Larry
