This is a discussion on rearranging columns in a text file within the Shell scripting forums, part of the Development/Scripting category; Hi to all. I am new to linux. I am using redhat linux. data is like this in a text ...
|
|||||||
| Register | FAQ | Members List | Calendar | Forgotten your password? | Mark Forums Read |
|
|||
|
Hi to all.
I am new to linux. I am using redhat linux. data is like this in a text file First column second column Ramesh , aiubghed Ramesh , ghed Ramesh , aiubaiub Suresh , aghedghed Suresh , aigheded Suresh , aiughedhed Kathir , aiddtghed Kathir , ghteteed Kathir , aiuopiiub john , agheddlked john , aigpqwsed john , aidffedhed first column having names and second column having its corresponding data.. i need a output like this First column-Second column - Third column Ramesh - Suresh - Kathir aiubghed - aghedghed - aiddtghed ghed - aigheded - ghteteed aiubaiub - aiughedhed - aiuopiiub and so on... In first column uniq field should come as a heading and corresponding second column as a column. like this i have to do for 5000 names and it corresponding values... Is it possible to do it in awk or sed. I am new to linux. please some help .. Thanks in advance.. with kind regards ramesh |
| Sponsored Links | ||
|
|
|
|||
|
[quote]
result file is in two column format; first column (SHEETs,SSBONDs,CISPEPs..etc....) and second column (ASP,PHE, MET... etc) Code:
SHEET ,MET SHEET ,ASP SHEET ,PHE SHEET ,SER SHEET ,THR SHEET ,ALA SHEET ,LEU SHEET ,LEU SHEET ,MET SHEET ,SER SHEET ,ALA SHEET ,GLN SSBOND,CYS SSBOND,CYS SSBOND,CYS SSBOND,CYS SSBOND,CYS SSBOND,CYS SSBOND,CYS SSBOND,CYS CISPEP,THR CISPEP,ALA CISPEP,ALA CISPEP,THR CISPEP,ALA CISPEP,THR CISPEP,ALA CISPEP,THR [/color] [quote] i have to convert this two column type into firt column,second column, and thirdcolumn like which i have shown below... MET ASP PHE SER THR ALA LEU LEU MET SER ALA GLN [quote] Second column [code] SSBOND CYS CYS CYS CYS CYS CYS CYS CYS [quote] Third column [code] CISPEP THR ALA ALA THR ALA THR ALA THR [code] Thanks for your reply. Help me in this.. with kind regards ramesh |
![]() |
| Bookmarks |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| To find and replace in text file | nashtech | Shell scripting | 3 | 07-31-2008 07:46 PM |
| Cups is not printing text file with proper format, staircasing issue | Ashish Pathak | CentOS / RHEL / Fedora | 1 | 11-18-2007 09:12 AM |
| help me in editing this columns | sureshbup | Shell scripting | 1 | 12-12-2006 03:29 PM |
| Calculations across different lines & columns of a file | Guest | Shell scripting | 2 | 09-16-2005 05:18 AM |
| Replacing text in a file using awk | postyrus | Shell scripting | 4 | 05-02-2005 04:31 PM |