LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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 11-17-2005, 07:59 AM   #1
windhair
LQ Newbie
 
Registered: Oct 2005
Posts: 16

Rep: Reputation: 0
Unhappy How can I sort the lines in a file?


Hi, all
I have a file withe many lines, the aim is to sort the lines based on the first alphabet of Each line, is there any simple way to do it? such as command in vim?

Thanks
 
Old 11-17-2005, 08:18 AM   #2
stickman
Senior Member
 
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
You could use the sort command.
 
Old 11-17-2005, 08:37 AM   #3
windhair
LQ Newbie
 
Registered: Oct 2005
Posts: 16

Original Poster
Rep: Reputation: 0
Thanks, I just found this works well. I only think about to work it out using vim command.

Great treatures are hiden in Linux, but I can only find tiny part.
 
  


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
erase all the lines of a file Prasun1 Linux - General 9 11-06-2005 10:53 AM
Sort file based on only ONE colum smart_sagittari Linux - Newbie 6 07-08-2005 12:25 AM
How to remove lines from a file doza Linux - General 2 04-27-2005 11:59 AM
what sort of file attribute is this: b--Srws-wt BrianK Linux - General 6 12-17-2004 11:26 PM
Reverse Sort Text File BxBoy Linux - General 1 08-02-2004 10:13 AM


All times are GMT -5. The time now is 08:50 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