A perl oneliner would do: perl -i.bak -pe 's/[^[:ascii:]]//g' <your file>
-i
says that the file is going to be edited inplace, and the backup is going to be saved with extension .bak
.
More Related Contents:
- Remove multi-line comments
- Insert a line at specific line number with sed or awk
- Remove line if field is duplicate
- delete a column with awk or sed
- remove ^M characters from file using sed
- How to use awk to print lines where a field matches a specific string?
- What is the difference between sed and awk? [closed]
- How do you delete all lines that contain no letters from the alphabet using either grep, sed, or awk? [closed]
- Is it possible to replace a newline AND another character with a single tab using sed?
- How can I manipulate text in bash? [closed]
- substitute words on a line only before first delimeter using sed or awk
- How can I replace each newline (\n) with a space using sed?
- Using different delimiters in sed commands and range addresses
- How to merge every two lines into one from the command line?
- How to delete duplicate lines in a file without sorting it in Unix
- Extraction of data from a simple XML file
- Using different delimiters in sed commands and range addresses
- Remove all text before colon
- How to remove trailing whitespaces with sed?
- Do a tail -F until matching a pattern
- What are the differences between Perl, Python, AWK and sed? [closed]
- Removing Windows newlines on Linux (sed vs. awk)
- Uppercasing First Letter of Words Using SED
- Add text at the end of each line
- sed: Replace part of a line
- Print lines in file from the match line until end of file
- Extract lines between two patterns from a file [duplicate]
- Have sed ignore non-matching lines
- Awk replace a column with its hash value
- How to delete rows from a csv file based on a list values from another file?