LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 03-13-2004, 12:11 PM   #1
trihai44100
LQ Newbie
 
Registered: Jun 2003
Posts: 12

Rep: Reputation: 0
Alphabetical Listing of Text


I have a text file with the names of a bunch of people. How can I make it so that they are listed alphabetically from their last name?

For example:
George Washington
George Bush
Richard Nixon

I want that to become:
George Bush
Richard Nixon
George Washington
 
Old 03-13-2004, 12:34 PM   #2
Mingus Rockbutt
LQ Newbie
 
Registered: Mar 2004
Posts: 1

Rep: Reputation: 0
providing everyone has only a first and a surname just use
Code:
sort +1 filename
, or to confuse the issue,
Code:
sort -k 2 filename'
(both sort using the second field in the text).

Mingus

Last edited by Mingus Rockbutt; 03-13-2004 at 12:37 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How change text color using linux in text mode only runlevel 3? Xavius Linux - General 7 05-07-2009 03:19 AM
Which light text editor can copy text from file and paste in browser? davidas Linux - Software 9 03-06-2006 12:28 PM
Show LFs & TABs in listing text files fiomba Linux - Software 0 12-02-2005 04:58 AM
Alphabetical sort wierdness SuperNull Linux - General 2 11-18-2005 01:21 AM
How to find and change a specific text in a text file by using shell script Bassam Programming 1 07-18-2005 08:15 PM


All times are GMT -5. The time now is 12:34 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration