home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / unix / question / 14616 < prev    next >
Encoding:
Text File  |  1992-12-11  |  850 b   |  23 lines

  1. Newsgroups: comp.unix.questions
  2. Path: sparky!uunet!coplex!trebor!root
  3. From: root@trebor.uucp (Bob Stockler)
  4. Subject: Re: a sort question
  5. Organization: Bob Stockler
  6. Date: Fri, 11 Dec 1992 22:55:22 GMT
  7. Message-ID: <1992Dec11.225522.23590@trebor.uucp>
  8. References: <4564@bimacs.BITNET>
  9. Lines: 12
  10.  
  11. yedidya@bimacs.BITNET (Yedidya Israel) writes:
  12.  
  13. >I want to sort a file according to two keys i.e. lines that equal
  14. >first key are compared upon their second key (sort +3-3.10 +3.12-3.14
  15. >in my case). My question concerns lines that equals in both keys how
  16. >do I guarantee that their order will be kept as in input file ???
  17.  
  18. One way (I think) to _guarantee_ it would be to pipe the input through "nl"
  19. and use the input line numbers appropriately as an additional sort key.
  20.  
  21. -- 
  22. Bob Stockler                   bob@trebor.uucp                   CIS: 72726,452
  23.