Sometimes I have text files with a trailing carriage return character like this:
# vi file.txt
...
"foo"^M
"foo"^M
...
To remove them I use sed (when dos2unix is not available):
# cat file.txt | sed 's/\r//' > new.txt
# vi new.txt
...
"foo"
"foo"
...
No comments:
Post a Comment