![]() |
|
|
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 |
| Conditionally joining lines in vi | ifermon | UNIX for Dummies Questions & Answers | 0 | 06-04-2008 10:43 AM |
| Joining lines from two files - please help | chandra004 | Shell Programming and Scripting | 25 | 07-27-2006 03:39 AM |
| Joining 2 lines in a file together | m223464 | Shell Programming and Scripting | 3 | 05-12-2005 12:42 PM |
| Joining multiple lines | beilstwh | Shell Programming and Scripting | 4 | 03-02-2005 05:51 AM |
| Joining lines in log file | bubba112557 | Shell Programming and Scripting | 3 | 05-18-2004 08:10 AM |
|
|
LinkBack | Thread Tools | Search this Thread |
Rating:
|
Display Modes |
|
||||
|
Joining 3 lines at a time
Hi,
I have a file which has the contents as below : 07:38:36 EST date 20041117 07:39:06 EST 07:00:29 EDT date 20050504 07:25:16 EDT 07:00:40 EDT date 20050505 07:23:12 EDT I need to delete the new line character from all lines except 3rd,6th,9th etc. lines so that i get the output as below : 07:38:36 EST date 20041117 07:39:06 EST 07:00:29 EDT date 20050504 07:25:16 EDT 07:00:40 EDT date 20050505 07:23:12 EDT How can I achieve this ?? I tried some combinations of sed which I know but no success ...... for eg: sed 'N;s/\n/ /' can join pairs of lines ... but not 3 lines at a time .. I am searching for some kind of one liner like that .. not a script .. Can anyone pls help ?? |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|