Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site u1100a.UUCP Path: utzoo!watmath!clyde!burl!ulysses!gamma!pyuxww!u1100a!sr From: sr@u1100a.UUCP (Steven Radtke) Newsgroups: net.unix-wizards Subject: Re: Adding up columns of numbers- do you have stat(1G) Message-ID: <796@u1100a.UUCP> Date: Fri, 29-Mar-85 14:57:19 EST Article-I.D.: u1100a.796 Posted: Fri Mar 29 14:57:19 1985 Date-Received: Sat, 30-Mar-85 02:19:06 EST References: <9273@brl-tgr.ARPA> <154@tove.UUCP> Reply-To: sr@u1100a.UUCP (Steven Radtke) Organization: Bell Communications Research, Piscataway, NJ Lines: 30 Summary: >>P.S. One strange omission (to my knowledge) from all the UNIX tools >>is a program, similar in command syntax (groan, but probably needed) >>to 'sort' which adds up columns of numbers: >> >> sumcol +4.6 foo >> >>Strange, must have been written hundreds of times. > >Awk is great for this. Something like: awk '{sum += $4}\\ >END {print sum}' > -mark If you have graphics in /usr/bin, type "graphics" and when you get the prompt "^" type "whatis" - surprise! user-friendly help messages from UNIX that tell you what you need to know. Other useful math utilities are available to users include: mean and variance, powers, roots, exponentials, logs, rand, etc. These commands are in UNIX 1100 and an ATT SysV UNIX I checked. They are in /usr/bin/graf and they understand vectors. A table usually has to be "cut" and piped to produce the vectors appropriate for the intended calculation. Like a spreadsheet with a stick shift. Have fun. Steve Radtke {ihnp4,houxm,pyux*}!u1100a!sr Bell Communications Research, Inc. Good Old New Jersey ---> seen Brooke Shields in our latest propaganda???