I searched a bit, but didn't find a solution for this specific situation. Given a pipe that outputs groups of an arbitrary number of non-blank lines separated single blank lines, is there a sed one-liner (or awk one-liner or perl one-liner) that will combine the groups of non-blank lines into single lines, while preserving the blank lines? For example, the input
one
two
three
four
five
six
seven
eight
should be output as
one two
three four five
six
seven eight
Thanks in advance to all who respond.