Hi All,
I have a question regarding text substitution.
I have a file that contains a lot of text.
Some of the text is separated with a \n like:
So there are both actual newlines and 'used to be newlines' in the text.
using tr
or using sed
I get the same result: They both replace all the actual newlines in the text file with a comma but NONE of the \n in the file get replaced...
I would like to have the reverse. I would like to keep the newlines and replace any \n in the file with a comma.
Does anyone have an idea?
I have a question regarding text substitution.
I have a file that contains a lot of text.
Some of the text is separated with a \n like:
Code:
TEST\nTEST2\nTEST3
BLA\nBLA2\nBLA3
using tr
Code:
tr "\n" ","
Code:
sed 's/\n/,/'
I would like to have the reverse. I would like to keep the newlines and replace any \n in the file with a comma.
Does anyone have an idea?