Effectively what you want to do is remove any blank lines and then join every second remaining to it's predecessor. So... (untested)
#open INPUT and OUTPUT while (<INPUT>) { chomp; next if m/^\s+$/; my $nextline; chomp($nextline = <INPUT> ) while $nextline !~ m/^\s+/; print OUTPUT $_,' ',$nextline; } #close INPUT and OUTPUT
In reply to Re: Re: Remove newlines and join lines
by BrowserUk
in thread Remove newlines and join lines
by hewarn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |