I have input.txt
1 2 3 4 5
I need to get such output.txt
1,2,3,4,5
How to do it?
In response to @Jonathan's comment to @eumiro's answer:
tr -s '\r\n' ',' < input.txt | sed -e 's/,$/\n/' > output.txt