Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site trwatf.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!trwatf!root From: root@trwatf.UUCP (Lord Frith) Newsgroups: net.unix-wizards Subject: Re: Adding up columns of numbers... Message-ID: <992@trwatf.UUCP> Date: Fri, 14-Jun-85 08:53:16 EDT Article-I.D.: trwatf.992 Posted: Fri Jun 14 08:53:16 1985 Date-Received: Tue, 18-Jun-85 00:23:33 EDT References: <975@trwatf.UUCP> Organization: TRW Advanced Technology Facility, Merrifield VA. Lines: 37 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@SEISMO "Give a man a horse... and he thinks he's enormous"