Last active
December 11, 2015 20:48
-
-
Save theanalyst/4657278 to your computer and use it in GitHub Desktop.
Removes non printable (possibly control characters) in files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun remove-non-print-ascii() | |
"Remove non printable ascii characters from buffer" | |
(interactive) | |
(save-match-data | |
(save-excursion | |
(goto-char (point-min)) | |
(while (re-search-forward "[^ -~\n]" (point-max) t) | |
(replace-match "" nil nil)) | |
(message "Removed non-printable ascii chars")))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment