Skip to main content
3 of 3
Change tags for ones that fit the topic, reformat and rephrase the question.

Replace non-ASCII characters with space in a file

I am using the following command to replace the non-ASCII characters, single quotes and non printable characters:

sed -i -e "s/'//g" -e's/'//g' -e's/[\d128-\d255]//g' -e's/\x0//g' filename 

However, I am getting an error:

sed: -e expression #3, char 18: Invalid collation character 

How can I replace these characters?

Azhar
  • 11
  • 3
  • 7