I want to replace non-ASCII characters or specific ASCII characters with a space in a file using shell scripting, sed or Perl.
First is to replace all non-ASCII characters with space in file. That I know we can do using below command
perl -pi -e 's/[[:^ascii:]]/ /g'
There are certain ASCII characters as well which downstream cannot accept, so I would want to replace those characters with a space. For example, ASCII character with value 0x19 (EM - end of medium) is not accepted by downstream and I want to replace it with space.
Also I know a range of ASCII characters with which downstream has a problem and I would want to replace each of them with a space.
Can I get help to accomplish this?
Note: Perl version in our system is 5.8.4. I want to do this exercise on Solaris 10 machine.
Thanks