From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f678f,919c32b3c140700e,start X-Google-Attributes: gidf678f,public From: Parker Barrington Subject: Problem Sorting on Two Keys Date: 1997/07/17 Message-ID: <33CEC873.7B68@dbis.ns.ca>#1/1 X-Deja-AN: 257513775 Organization: ISINet, Nova Scotia Reply-To: parkerb@dbis.ns.ca Newsgroups: comp.unix.osf.misc Has anyone had any success sorting on two keys using a delimiter. In my case | is the delimiter. I want to sort on the 4th field and within all occurrences of the 4th field I want to sort on the 3rd field, ie sort -t\| -k4 -k3 filename filename output looks like the following after using the above sort command - field 4 is ordered OK but field 3 (ie Charles, Karen & Brian Smith) are not in order. Any help is appreciated, TIA. S530|SMITH|Brenda J.|Heinsma|heinsma@mail.atcon.com S530|SMITH|Arthur|Johnson|ahjhnsn@aol.com S530|SMITH|Don|Park|donpark@igs.net S530|SMITH|Claire|Smith-Burns|passinc@awinc.com S530|SMITH|Terri|Smith-Weller|smithwel@u.washington.edu S530|SMITH|Charles Paul|Smith|73702.466@compuserve.com L534|LANDELLS|Karen|Smith|KSMITH@SWBI.NET S530|SMITH|Brian|Smith|gsmith@pica.army.mil S530|SMITH|Heather|Stanley|heathers@gp.apl.cul.ca S530|SMITH|Nelson M.|Warner|nmwarner@naples.net -- Parker Barrington parkerb@tuns.ca parkerb@dbis.ns.ca