Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/17/84; site hao.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!wjh12!harvard!seismo!hao!woods From: woods@hao.UUCP (Greg "Bucket" Woods) Newsgroups: net.unix Subject: Sort(1) on E-format numerics Message-ID: <1181@hao.UUCP> Date: Thu, 27-Sep-84 15:08:15 EDT Article-I.D.: hao.1181 Posted: Thu Sep 27 15:08:15 1984 Date-Received: Sat, 29-Sep-84 09:49:18 EDT Distribution: net Organization: High Altitude Obs./NCAR, Boulder CO Lines: 22 We have a need to numerically sort files which contain columns of numbers in E-format, i.e. something of the form [+-]#.####e[+-]##, where "#" means a digit and [+-] means an optional sign. Unfortunately, the -n option to sort(1) does not recognize exponents and stops numerical conversion of the sort field when it sees the "e". This results in incorrect sorting in some cases, like it will put 1.0e-07 before 2.0e-09. So, before I go through the hassle of hacking the source code for sort(1), or writing another whole program to do this, I'd like to know if anyone else has already invented this wheel. Has anyone hacked sort(1) to do this correctly? I will settle for any kludges that would work with existing programs as well. Various thoughts of running sort(1) twice have crossed my mind, but I have yet to come up with anything that will work reliably in all cases. Any ideas? Please *mail* me any hints. If someone comes up with an answer, I will post it to the net. We are running 4.2BSD on a VAX 11/750, in case that matters. --Greg -- {ucbvax!hplabs | allegra!nbires | decvax!stcvax | harpo!seismo | ihnp4!stcvax} !hao!woods " She could make happy, any man alive..."