The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
sort problem talashil Shell Programming and Scripting 4 04-11-2008 12:56 PM
how to use awk to sort this problem out sonicstage Shell Programming and Scripting 4 04-07-2008 09:04 AM
sort -k Indalecio Shell Programming and Scripting 4 03-16-2007 01:00 AM
Sorting problem "sort -k 16,29 sample.txt > output.txt" ganapati Shell Programming and Scripting 3 08-01-2006 02:55 AM
Problem with sort jyoung UNIX for Dummies Questions & Answers 1 04-13-2006 09:57 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 06-29-2006
Registered User
 

Join Date: Jan 2006
Location: fairfax virginia
Posts: 54
SORT problem on SUN

Hello,

I tried to sort on column2 followed by column1 and notice how the "updated" value in column1 is not sorted correctly!

Can you tell me if i have the sort statement setup correctly please, thanks much!


sort -t "|" -k2 -k1 sortin > sortout


caller|wf_item|WF_ITEM.doc|Create_Item|Item_Exist|516
caller|wf_item|WF_ITEM.doc|Create_Item|Item_Exist|517
caller|WF_ITEM|WF_ITEM.doc||in|7
caller|wf_item|WF_ITEM.doc|InitCache|SetEndDate|162
caller|wf_item|WF_ITEM.doc|InitCache|SetEndDate|163
caller|wf_item|WF_ITEM.doc|InitCache|SetEndDate|172
caller|wf_item|WF_ITEM.doc|InitCache|SetEndDate|194
caller|wf_item|WF_ITEM.doc|InitCache|SetEndDate|194
ubdated|wf_item|WF_ITEM.doc|InitCache|SetEndDate|194
ubdated|wf_item|WF_ITEM.doc|InitCache|SetEndDate|194
caller|wf_item|WF_ITEM.doc|InitCache|SetEndDate|195
caller|wf_item|WF_ITEM.doc|InitCache|SetEndDate|195
ubdated|wf_item|WF_ITEM.doc|InitCache|SetEndDate|195
ubdated|wf_item|WF_ITEM.doc|InitCache|SetEndDate|195
caller|wf_item|WF_ITEM.doc|InitCache|SetEndDate|200
caller|wf_item|WF_ITEM.doc|InitCache|SetEndDate|201
caller|WF_ITEM|WF_ITEM.doc|InitCache|SetEndDate|205
caller|Wf_Item|WF_ITEM.doc|Root_Process|Item_Exist|444
caller|wf_item|WF_ITEM.doc|Root_Process|Item_Exist|445
caller|wf_item|WF_ITEM.doc|Root_Process|Item_Exist|446
caller|wf_item|WF_ITEM.doc|SetItemUserKey|GetItemUserKey|383
caller|wf_item|WF_ITEM.doc|SetItemUserKey|GetItemUserKey|384
caller|wf_item|WF_ITEM.doc|SetItemUserKey|GetItemUserKey|385
caller|Wf_Item|WF_ITEM.doc|SetItemU
Reply With Quote
Forum Sponsor
  #2  
Old 06-29-2006
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 4,298
Code:
 sort -t'|' -k 2.1,2.10 -k 1.1,1.10 filename
output
Code:
caller|WF_ITEM|WF_ITEM.doc|InitCache|SetEndDate|205
caller|WF_ITEM|WF_ITEM.doc||in|7
caller|Wf_Item|WF_ITEM.doc|Root_Process|Item_Exist|444
caller|Wf_Item|WF_ITEM.doc|SetItemU
caller|wf_item|WF_ITEM.doc|Create_Item|Item_Exist|516
caller|wf_item|WF_ITEM.doc|Create_Item|Item_Exist|517
caller|wf_item|WF_ITEM.doc|InitCache|SetEndDate|162
caller|wf_item|WF_ITEM.doc|InitCache|SetEndDate|163
caller|wf_item|WF_ITEM.doc|InitCache|SetEndDate|172
caller|wf_item|WF_ITEM.doc|InitCache|SetEndDate|194
caller|wf_item|WF_ITEM.doc|InitCache|SetEndDate|194
caller|wf_item|WF_ITEM.doc|InitCache|SetEndDate|195
caller|wf_item|WF_ITEM.doc|InitCache|SetEndDate|195
caller|wf_item|WF_ITEM.doc|InitCache|SetEndDate|200
caller|wf_item|WF_ITEM.doc|InitCache|SetEndDate|201
caller|wf_item|WF_ITEM.doc|Root_Process|Item_Exist|445
caller|wf_item|WF_ITEM.doc|Root_Process|Item_Exist|446
caller|wf_item|WF_ITEM.doc|SetItemUserKey|GetItemUserKey|383
caller|wf_item|WF_ITEM.doc|SetItemUserKey|GetItemUserKey|384
caller|wf_item|WF_ITEM.doc|SetItemUserKey|GetItemUserKey|385
ubdated|wf_item|WF_ITEM.doc|InitCache|SetEndDate|194
ubdated|wf_item|WF_ITEM.doc|InitCache|SetEndDate|194
ubdated|wf_item|WF_ITEM.doc|InitCache|SetEndDate|195
ubdated|wf_item|WF_ITEM.doc|InitCache|SetEndDate|195
Reply With Quote
  #3  
Old 06-29-2006
Registered User
 

Join Date: Jan 2006
Location: fairfax virginia
Posts: 54
Thanks a lot Jim for the help!

that did the trick!

Spent hours on that without any progress!

Have a great 4th Jim!
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 11:47 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