Strip characters from a file

I work with text files in QNX that have comments in Japanese. If the QNX machine is not setup for with a Japanese font, VI and VEDIT both have problems with the files.

I need a quick and easy way to strip all non-ASCII character from a file. I think “tr” could work but I don’t know how to tell it to keep all ASCII characters and strip everything else.

Can any one help?

I found the answer to my own question.

The following command will do what I need.

tr -dc -r filename [’\0’-’\177’]

where 0 and 177 are the octal equivilant of a character I wish to keep.
to strip a single character use this.

tr -d -r filename “\015”

where 015 is the octal equivilant of a character I wish to delete (carriage return)