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
Ascending order within text kerpm Shell Programming and Scripting 5 08-15-2008 06:39 AM
Display modified files in ascending order balareddy UNIX for Advanced & Expert Users 1 08-13-2008 02:48 AM
Ascending & Descending order numbers pravani1 Shell Programming and Scripting 6 06-03-2008 04:43 AM
use of sed over cat to merge files miwinter UNIX for Advanced & Expert Users 2 11-28-2007 10:36 AM
Sort / ascending order gyik UNIX for Dummies Questions & Answers 1 03-05-2001 07:08 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #8  
Old 09-03-2008
dj -------
 

Join Date: Feb 2007
Location: Cochin/Bangalore, India
Posts: 439
Quote:
Originally Posted by user_prady View Post
Thanks for your reply But I want to sort reverse for the second key ..
Ok..If you need it in ev order of second col,

Code:
sort -t":" -k1,1n -k2,2r file1 file2
O/p:
Quote:
9 : TXADDR : 00000000
9 : RXADDR : 00000001
65 : TXDATA 0000000000000011
65 : RXDATA 0000000000000011
83 : TXDATA 0000000000000012
83 : RXDATA 0000000000000012
102 : RXDATA 0000000000000013
453 : TXADDR : 00000000
453 : RXADDR : 00000000
509 : TXDATA 0000000000000001
509 : RXDATA 0000000000000001
527 : TXDATA 0000000000000002
527 : RXDATA 0000000000000002
546 : RXDATA 0000000000000003
879 : TXADDR : 00000020
879 : RXADDR : 00000020
934 : TXDATA 0000000000000011
934 : RXDATA 0000000000000011
953 : TXDATA 0000000000000012
953 : RXDATA 0000000000000012
971 : TXDATA 0000000000000013
971 : RXDATA 0000000000000013
990 : RXDATA 0000000000000014
Reply With Quote
Forum Sponsor
  #9  
Old 09-03-2008
Registered User
 

Join Date: Sep 2007
Posts: 163
Quote:
Originally Posted by dennis.jacob View Post
Code :

Code:
sort -t":" -k1,1n -k2,2 file1 file2
Output:
Oh oh . I think I am misguiding you all .

Desired Output :
Code:
9 : TXADDR : 00000000
9 : RXADDR : 00000001
65 : TXDATA 0000000000000011
65 : RXDATA 0000000000000011
83 : TXDATA 0000000000000012
83 : RXDATA 0000000000000012
102 : RXDATA 0000000000000013
453 : TXADDR : 00000000
453 : RXADDR : 00000000
509 : RXDATA 0000000000000001
509 : TXDATA 0000000000000001
527 : TXDATA 0000000000000002
527 : RXDATA 0000000000000002
546 : RXDATA 0000000000000003
879 : TXADDR : 00000020
879 : RXADDR : 00000020
....................
......................
again thanks a ton for your time..

Regards,
user_prady
Reply With Quote
  #10  
Old 09-03-2008
dj -------
 

Join Date: Feb 2007
Location: Cochin/Bangalore, India
Posts: 439
Quote:
Originally Posted by user_prady View Post
Oh oh . I think I am misguiding you all .
Regards,
user_prady
Have you tried the seond one which I posted..?
Reply With Quote
  #11  
Old 09-03-2008
Registered User
 

Join Date: Sep 2007
Posts: 163
Quote:
Originally Posted by dennis.jacob View Post
Have you tried the seond one which I posted..?
Oh sorry I m not aware of the second page ..

Anyway thanks a lot ..
Thats the output I really want ..


Thanks & Rgds,
user_prady
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:25 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