![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how to join lines | glamo_2312 | UNIX for Dummies Questions & Answers | 8 | 09-16-2008 05:17 AM |
| Join Every 5 Lines With $ Symbol | ntgobinath | Shell Programming and Scripting | 3 | 05-08-2008 11:01 AM |
| to join the corresponding lines using shell commands or awk | cdfd123 | Shell Programming and Scripting | 7 | 12-10-2007 04:45 PM |
| Awk Join multiple lines | hitmansilentass | Shell Programming and Scripting | 5 | 10-27-2006 12:04 PM |
| join two lines together | tine | Shell Programming and Scripting | 4 | 12-12-2003 12:34 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
How can i join three lines into one in unix?
Hi all, I am trying to merge three lines into one in my unix text file. My text file sis omething like this. Code:
xxxxxxxxx yyyyyyyyyyy zzz aaaaaaaaa bbbbbb ccccc Expected out put is Code:
xxxxxxxxx yyyyyyyyyyy zzz aaaaaaaaa bbbbbb ccccc I tried with awk as shown below. Code:
awk '{printf $0 " "; getline; print $0}'
But it is working only for merging two lines. Please help me in modifying this awk or any other alternative for this? |
| Bookmarks |
| Tags |
| merge, unix |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|