Re: Simple join of 2 lines!!! Arrgh!
From: Ed Morton (morton_at_lsupcaemnt.com)
Date: 01/30/04
- Next message: David Douthitt: "Re: changing my username on unix on MAC"
- Previous message: Ed Morton: "Re: for loop (?)"
- In reply to: Stein Arne Storslett: "Re: Simple join of 2 lines!!! Arrgh!"
- Next in thread: Carlos J. G. Duarte: "Re: Simple join of 2 lines!!! Arrgh!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 30 Jan 2004 11:25:44 -0600
Stein Arne Storslett wrote:
> <shauny@shauny.com> wrote in <c34c8453.0401300136.2be85c6a@posting.google.com>:
>
>>Hi
>>
>>I have a file thus:
>>
>> aaaaaaaaaaaaaaEOLXXXX
>> bbbbbbbbbbbbbbb
>> cccccccccccccccEOLXXXX
>> ddddddddddddddd
>>
>>and I want this:
>>
>> aaaaaaaaaaaaa bbbbbbbbbbbbb
>> cccccccccccccc ddddddddddddd
<snip>
> $ awk '{ printf $0" " ; getline ; print }' laban
> aaaaaaaaaaaaaaEOLXXXX bbbbbbbbbbbbbbb
> cccccccccccccccEOLXXXX ddddddddddddddd
> aaaaaaaaaaaaaaEOLXXXX bbbbbbbbbbbbbbb
> cccccccccccccccEOLXXXX ddddddddddddddd
>
That isn't the output the OP wanted as it still has the EOLXXXX in it.
This will do it:
gawk '{c=sub("EOLXXXX$"," ");printf "%s",$0}c==0{print ""}'
Regards,
Ed.
- Next message: David Douthitt: "Re: changing my username on unix on MAC"
- Previous message: Ed Morton: "Re: for loop (?)"
- In reply to: Stein Arne Storslett: "Re: Simple join of 2 lines!!! Arrgh!"
- Next in thread: Carlos J. G. Duarte: "Re: Simple join of 2 lines!!! Arrgh!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]