Sometimes I need to read log files that have ^M (control-M) in the line endings. I can do a global replace to get rid of them, but then something more is logged to the log
Put this in your .emacs:
(defun dos2unix () "Replace DOS eolns CR LF with Unix eolns CR" (interactive) (goto-char (point-min)) (while (search-forward "\r" nil t) (replace-match "")))
Now you can simply call dos2unix and remove all the ^M characters.
dos2unix
^M