You may need to do this when you import a text file from MS-DOS (or MS-Windows), and forget to transfer it in ASCII or text mode. Here are several ways to do it; pick the one you are most comfortable with.
% sed -e "s/^M//" filename > newfilenameTo enter ^M, type CTRL-V, then CTRL-M. That is, hold down the CTRL key then press V and M in succession.
% vi filenameInside vi [in ESC mode] type:
:%s/^M//gTo enter ^M, type CTRL-V, then CTRL-M. That is, hold down the CTRL key then press V and M in succession.
M-x replace-string RET C-q C-m RET RETwhere "RET" means <press the return key> and C-q and C-m mean <hold the CTRL key and press the m (or q) key>.
| Please tell us what you think of this page! |
Back to [Help/News page]