![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| 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 !! |
|
|
||||
| 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 |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Code:
sort -t'|' -k 2.1,2.10 -k 1.1,1.10 filename 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 |
|
#3
|
|||
|
|||
|
Thanks a lot Jim for the help!
that did the trick!
Spent hours on that without any progress! Have a great 4th Jim! |
|||
| Google The UNIX and Linux Forums |