Is there an issue with sed and new line character?
I have a file test.txt with the following contents
aaaaa bbbbb ccccc ddddd
The following does not work:
sed -r -i 's/\n/,/g' test.txt
I know that I can use
tr for this but my question is why it seems not possible with sed.
If this is a side effect of processing the file line by line I would be interested in why this happens. I think
grep removes new lines. Does sed do the same?