Hi,
I have some problems with whitespace characters in a txt document.
I have converted the newline characters \n\r but still have some problems with whitespace.
It is identified by ^M.
How do i get rid of it?
Thanks,
Solved: Remove the ^M Character
Re: Remove the ^M Character
When you move files from windows to (l)unix, you always have problems with white characters.
Thats because windows and linux handle with spaces differently.
Sed can be found on most linux/unix distributions.
you can also do the same with perl:
probably the easiest way is dos2unix,
Let us know if it works.
Thats because windows and linux handle with spaces differently.
Sed can be found on most linux/unix distributions.
Code: Select all
sed s/\r// hello.txt > goodhello.txt
Code: Select all
perl -pie 's/\r//g' hello.txt > goodhello.txt
Code: Select all
dos2unix [options] [-c convmode] [-o file ...] [-n infile outfile ...]