Join multiple adjacent lines into one line in UNIX, Linux

2008 January 21

I'm looking for the opposite or the converse of GNU fold — a command line program that would join word-wrapped text into a single line per paragraph. In other words, something that would take input containing adjacent lines of text like this:

now is
the time for
all good men

to come to the
aid of their

where adjacent paragraphs were separated with blank lines, and produce output with one line per paragraph, like this:

read more…


Comments are closed.

%d bloggers like this: