Hi,
how do I replace all the newline characters (\n) in a text file?
replace newline in text file
Re: replace newline in text file
You can use sed
replace it with FOO:
or just remove it:
replace it with FOO:
Code: Select all
sed '{:q;N;s/\n/FOO/g;t q}' /path/text.txt
Code: Select all
sed '{:q;N;s/\n//g;t q}' /path/text.txt