Sed Solution
$ sed -e ':a;N;$!ba;s/\(.\)\n/\1 /g' -e 's/\n/\n\n/' test.text
Note, that in this solution :a is creating a label and not using the a command.
Replacing Multiple Spaces
Use tr: $ tr -s ' ' <test.text
$ sed -e ':a;N;$!ba;s/\(.\)\n/\1 /g' -e 's/\n/\n\n/' test.text
Note, that in this solution :a is creating a label and not using the a command.
Use tr: $ tr -s ' ' <test.text