in reply to Re: Single newline removal when line exceeds x characters
in thread Single newline removal when line exceeds x characters
Here's one with a regex and a lookahead assertion.
local $/; $_ = <DATA>; my $wrap_min = 20; s/^(.{$wrap_min,})\n(?=\S)/$1 /gm; print; __DATA__ This is a longish line whose linebreak should be removed so that this line runs together with it. The preceding double linebreak should be conserved. This little line and this one should stay separated.
cheers
tachyon
s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Single newline removal when line exceeds x characters
by Roger (Parson) on Oct 20, 2003 at 08:04 UTC |