In perl
perl -n00E 'chomp;s/\n/ /g;say' your_file
Explanation
-n: Operate on the file record by record-00: Means the record separator is two or more consecutive newlines-E: execute the following string as code while setting the default variable ($_) to the record currently being read from the file.chomp: remove the record separator from$_s/\n/ /g: Replace every newline encountered in the current record with a space (thegmodifier ensures the replacement is "global").say: Prints the contents of$_with a newline added at the end. It is used here instead ofprintbecausechompwill have removed the newlines separating the different paragraphs. It is equivalent toprint "$_\n".- We needed to use
-Erather than-ebecause it enables the use of more recent language features; thesayfunction in this case.