|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Appending columns at the end of output using awk/sed
Hi , I have the below ouput, Code:
=====gopi===== assasassaa adsadsadsdsada asdsadsadasdsa sadasdsadsd =====kannan=== asdasdasd sadasddsaasd adasdd =====hbk=== asasasssa .... .. I want the output like as below, not able paste here correctly. Code:
=====gopi===== =====kannan=== =====hbk=== assasassaa asdasdasd asasasssa adsadsadsdsada sadasddsaasd asdsadsadasdsa adasdd sadasdsadsd Last edited by Scrutinizer; 06-20-2012 at 07:17 AM.. Reason: code tags |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
Try Code:
awk '/^=/ {
i=1
a[i]==""?a[i]=$0:a[i]=a[i]"\t"$0
}
!/^[=]/ {
i++
a[i]==""?a[i]=$0:a[i]=a[i]"\t"$0
}
END{i=1;while(a[i] != ""){print a[i];i++}}' inputfileLast edited by elixir_sinari; 06-20-2012 at 08:36 AM.. |
| The Following User Says Thank You to elixir_sinari For This Useful Post: | ||
eeegopikannan (06-20-2012) | ||
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
Thanks it worked. Its too good to see in excel sheet.
Thanks again ![]() ![]() |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Appending columns of two files using shell script | siri_886 | Shell Programming and Scripting | 1 | 12-22-2010 09:59 AM |
| Appending sed output to variable | jazzaddict | UNIX for Dummies Questions & Answers | 5 | 10-24-2010 11:34 AM |
| appending several columns with awk and paste | creamcheese | Shell Programming and Scripting | 2 | 07-03-2009 11:27 AM |
| Appending the last few columns to the front | ragavhere | Shell Programming and Scripting | 3 | 07-08-2008 09:11 AM |
| Appending columns on a file | abel | Shell Programming and Scripting | 2 | 09-27-2002 07:04 AM |
|
|