Remove end of line characters from stdout? Multiple lines into a single line

sed won't work (easily) because it operates on lines one at a time; you could do it, but it would involve copying the whole input into the hold buffer

tr actually should work the way you pasted it; are you sure the newlines are \ns? You can simplify it a bit by deleting the newlines instead of converting them to spaces:

tr -d '\n'

besides tr, some other methods you can use

awk

awk '1' ORS= file

shell

while read -r line; do printf "%s " "$line"; done <file

sed

sed -e ':a' -e 'N;s/\n/ /;ba' file