Unix/Linux Go Back    



Sort command in one column and not effect to another column

UNIX for Dummies Questions & Answers




Kindly Note - This is a Single User Post by Forum Member jim mcnamara Regarding:
Sort command in one column and not effect to another column.
Please Follow The Primary Link Above to View the Full Discussion.

   
Old Unix and Linux 03-22-2013
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
 
Join Date: Feb 2004
Last Activity: 19 September 2017, 10:39 PM EDT
Location: NM
Posts: 11,178
Thanks: 559
Thanked 1,093 Times in 1,009 Posts
Try:

Code:
awk '{print $2, $3}' inputfile | sort | nl > newfile

Edit: forgot field 3

Last edited by jim mcnamara; 03-22-2013 at 08:01 AM..
The Following User Says Thank You to jim mcnamara For This Useful Post:
GeodusT (03-22-2013)