in reply to Converting DOS perl to Unix
Since I have to work with a lot of code coming in from and going back out to Windows machines, I find this easier than a one-liner. To use it is a trivial matter of calling M-x dos-unix or M-x unix-dos.(defun dos-unix () (interactive) (goto-char (point-min)) (while (search-forward "\r" nil t) (replace-match ""))) (defun unix-dos () (interactive) (goto-char (point-min)) (while (search-forward "\n" nil t) (replace-match "\r\n")))
e-mail neshura
|
|---|