The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
sort on multiple keys teqmem UNIX for Advanced & Expert Users 1 04-12-2007 10:15 PM
Hot Keys cwtlr Shell Programming and Scripting 8 12-14-2006 10:07 AM
Hot Keys cwtlr UNIX for Dummies Questions & Answers 2 12-01-2006 10:50 AM
SSH Keys Help sysera UNIX for Advanced & Expert Users 1 08-09-2004 11:57 PM
arrow keys / special keys raguramtgr UNIX for Dummies Questions & Answers 3 02-19-2004 11:45 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #8  
Old 07-01-2008
Registered User
 

Join Date: Oct 2007
Location: USA
Posts: 568
Quote:
Originally Posted by clarcombe View Post
Excellent. That works perfectly


What does the -k4,4n -k5,5r mean. I understand the 4n part but what does the , do?

I modified the command
sort -t '|' -k4n -k5r BPC_TRANS_CHARG000009_000_Anomalie.csv and this works as well

Thanks.

Colin
The -k4,4n -k5,5r first sorts numerically on the fourth field and then sorts on the fifth field in reverse order. The 5th field sort is a sub-sort that is it sorts the 5th field based on the sorted contents of the 4th field.The comma in -k separates the start and stop fields. In -k5r the start field is the 5th one and as no stop field is given it defaults to the end of the line. The sort manpage provides a better explanation.
Reply With Quote
Forum Sponsor
  #9  
Old 07-02-2008
Registered User
 

Join Date: Jun 2008
Posts: 5
Quote:
The sort manpage provides a better explanation.
No, I think you are wrong there. Your explanation is far clearer than man sort.

English is my first language, man help is my fifth !!

Many Thanks

Colin
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 02:53 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0