Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!husc6!cmcl2!adm!xadmx!mchinni@pica.army.mil From: mchinni@pica.army.mil (Michael J. Chinni, SMCAR-CCS-E) Newsgroups: comp.unix.questions Subject: Re: sort question Message-ID: <19449@adm.BRL.MIL> Date: 4 May 89 14:53:12 GMT Sender: news@adm.BRL.MIL Lines: 27 > From: Dan Troxel > Subject: sort question > Date: 3 May 89 20:15:01 GMT > To: info-unix@sem.brl.mil > > How can I use the 'sort' command, to sort by two fields? > Example: > > _4 test _E _1 test _E > _2 test _E should be _2 test _E > _3 test _F _4 test _E > _1 test _E _3 test _F > Try: sort +10 -11 +2 -3 filename This tells sort to sort first on a field starting in col. 10 and ending just before col. 11, and secondly a field starting in col. 2 and ending just before col. 3. /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ Michael J. Chinni Chief Scientist, Simulation Techniques and Workplace Automation Team US Army Armament Research, Development, and Engineering Center User to skeleton sitting at cobweb () Picatinny Arsenal, New Jersey and dust covered terminal and desk () ARPA: mchinni@pica.army.mil "System been down long?" () UUCP: ...!uunet!pica.army.mil!mchinni /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/