Adding up columns of numbers...
Lord Frith
root at trwatf.UUCP
Fri Jun 14 22:53:16 AEST 1985
This could not be mailed directly....
Subject: Need instruction for sum-column srcipt
Please mail me (or post on net) the instruction on you
column-summing shell script
I tried something like "sum-column t1" where t1 is a file
containing 3 columns of numbers. The output is just a listing
of t1 but without any total.
I think I know the problem. I'll bet your file has ONLY columns of
numbers in it and know description strings in field one. Make sure
that columns of numbers are seperated by tabs (the script uses a tab
for its FS). Spaces are okay within the description strings.
La....
Rent $868 $865 $865
Electricity (average) $80 $50 $50
Phone (average) $68 $65 $65
Gas $80 $50 $65
Food $680 $650 $650
If this doesn't work for you then something must have happened to the
awk script on transmission.
Something I have noticed that disturbs me is why awk seems to think
that there is an object between field seperators when that object is
null. In other words; awk will process three consecutive tabs and say
that there are two fields whose values are null.
--
UUCP: ...{decvax,ihnp4,allegra}!seismo!trwatf!root - Lord Frith
ARPA: trwatf!root at SEISMO
"Give a man a horse... and he thinks he's enormous"
More information about the Comp.unix.wizards
mailing list