![]() |
|
|
|
|
|||||||
| 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 |
| how to use sed to sort out this question | sonicstage | Shell Programming and Scripting | 2 | 04-07-2008 12:39 AM |
| sort / cut question | BearCheese | Shell Programming and Scripting | 5 | 07-13-2007 03:40 PM |
| Sort/Grep Question | aarondesk | UNIX for Dummies Questions & Answers | 5 | 03-06-2006 02:57 PM |
| Sort Question | bobo | UNIX for Dummies Questions & Answers | 7 | 02-24-2006 09:04 AM |
| Using Sort | kemobyte | Shell Programming and Scripting | 1 | 11-30-2005 05:25 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
I'm looking for a sort command that will sort by zip code first then by last name. (zip code is the last field, last name is first field)
data file looks like this. Hope Bob 1234 Main ST. Colorado Springs, CO 80920 I was thinking along the lines of: sort –k9n address.data //for the zip code sort, but do if I do another sort would it screw up the zip code sort? I'm not at a UNIX machine so I'm doing this off the top of my head otherwise I would just experiment. Thanks in advance. |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Code:
sort -t" " -k9n -k1 file |
|
#3
|
|||
|
|||
|
Quote:
Thanks, I'll try it tonight! |
|||
| Google The UNIX and Linux Forums |
| Thread Tools | |
| Display Modes | |
|
|