Answer the question
In order to leave comments, you need to log in
How to replace line breaks with "\n" characters?
Hey!
Tell me how, using bash
or shell
, can I put visible characters instead of invisible hyphens \n
?
Those. given a text file of the form:
Бла
бла
бла
бла/nбла/nбла
?
Answer the question
In order to leave comments, you need to log in
Here is the answer .
/home/oracle/aaa>cat text.txt
bla
blah
bleah
/home/oracle/aaa>sed -e ':a' -e 'N' -e '$!ba' -e 's/\n/,/g' text.txt > ou
/home/oracle/aaa>cat ou
bla,blah,bleah
tr "\n" "n" < text.txt > ou
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question