LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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, 11:11 AM   #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, 11:34 AM   #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 11:37 AM.
 
  


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 02:19 AM
Which light text editor can copy text from file and paste in browser? davidas Linux - Software 9 03-06-2006 11:28 AM
Show LFs & TABs in listing text files fiomba Linux - Software 0 12-02-2005 03:58 AM
Alphabetical sort wierdness SuperNull Linux - General 2 11-18-2005 12:21 AM
How to find and change a specific text in a text file by using shell script Bassam Programming 1 07-18-2005 07:15 PM


All times are GMT -5. The time now is 01:06 PM.

Main Menu
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