Strip all non-ascii characters from a file
Published: 27-06-2013 | Author: Remy van Elst | Text only version of this article
Table of Contents
This snippet strips all non-ascii characters from a file. It backs up theoriginal file. This is handy if you have input for programs that bork on non-ascii input like older mainframes and such.
Tags: ascii, perl, snippets, utf-8
perl -i.bk -pe 's/[^[:ascii:]]//g;' filename