Skip to main content
2 of 2
deleted 5 characters in body
Steven D
  • 47.6k
  • 15
  • 123
  • 117

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

Steven D
  • 47.6k
  • 15
  • 123
  • 117