Re: change paragraphs to long lines

Thierry Blanc <[email protected]>
Newsgroups gmane.editors.sed.user
Message-ID <[email protected]>
try

sed -r '/^$/!{:a;N;/\n$/b;s|\n| |;ba}'



On 05/11/13 07:36, George Georgalis wrote:
>
>
> Hello sed list, hope you are all well.
>
> Long time subscriber but I've not been following lately, hope this
> hasn't come up recently.
>
> I have a file with double returns to denote paragraphs. I'd like to
> retain the double returns but join all the other lines, so paragraphs
> have long lines.
>
>
> so this:
> one two three one two three one two three one
> two three one two three one two three one two
> three one two three one two three one two
>
> one two three one two three one two three one
> two three one two three one two three one two
> three one two three one two three one two
>
> changes to this:
> one two three one two three one two three one two three one two three
> one two three one two three one two three one two three one two
>
> one two three one two three one two three one two three one two three
> one two three one two three one two three one two three one two
>
> Maybe this solution would good for the sed1line file?
>
> Regards,
> -George
>
>
> -- 
> George Georgalis, (415) 894-2710, http://www.galis.org/
>
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.