Quote:
Originally Posted by jv61
Any suggestions of how to do this with sed/awk?
|
Nope.
In Perl, you could do this:
Code:
perl -ne 'BEGIN {$f = 0}; chomp; print "\n" if (/^[^[]/ and $f); print "$_ "; $f = 1; END {print "\n"}' filename
Or, if you don't care about an initial blank line:
Code:
perl -ne 'chomp; print "\n" if (/^[^[]/); print "$_ "; END {print "\n"}' filename