LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-14-2015, 08:14 AM   #1
saeedsssss
Member
 
Registered: Apr 2012
Posts: 43

Rep: Reputation: Disabled
Sort text file


Hi
I want sort below text similar picture.
how we can doing that with command on Linux?

please see the attached.

Click image for larger version

Name:	sort.png
Views:	14
Size:	163.1 KB
ID:	17355

sort.txt
 
Old 01-14-2015, 08:28 AM   #2
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,110

Rep: Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873
what have you tried so far and where are you stuck.

i think you can try awk and set its Record Seperator to '====='
 
Old 01-14-2015, 09:24 AM   #3
saeedsssss
Member
 
Registered: Apr 2012
Posts: 43

Original Poster
Rep: Reputation: Disabled
I try convert sort.txt (left picture) to right picture.
 
Old 01-14-2015, 09:33 AM   #4
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,203

Rep: Reputation: 2675Reputation: 2675Reputation: 2675Reputation: 2675Reputation: 2675Reputation: 2675Reputation: 2675Reputation: 2675Reputation: 2675Reputation: 2675Reputation: 2675
you can start here:
http://www.linuxquestions.org/questi...tiline-805961/
or
http://www.linuxquestions.org/questi...orting-822178/
http://www.gentoo.org/doc/en/articles/l-awk2.xml
 
  


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
sort text file calexander Linux - Newbie 4 05-15-2010 12:57 PM
how to sort text file and split into smaller files michaeljoser Linux - Software 8 10-19-2007 01:50 AM
sorting text file - sort command man_linux Linux - General 16 08-09-2006 04:58 PM
Reverse Sort Text File BxBoy Linux - General 1 08-02-2004 10:13 AM


All times are GMT -5. The time now is 06:19 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration