I didn't forget the tr command, I replaced it with a sed equivalent (:a;N;s/\n/ /;ta), so that everything could be done with one command.
I used the -i option for inline edit, the various sed operations are separated by a semicolon.
:a is just a label
N appends next line with \n as separator (newline character)
s/\n/ / replaces a newline character with a space
ta returns to label "a" is the previous operation was successful