
April 21st, 2004, 10:34 AM
|
|
Contributing User
|
|
Join Date: Nov 2003
Posts: 122
Time spent in forums: 18 h 12 m 20 sec
Reputation Power: 5
|
|
replace non-ascii characters
Hi,
I'm trying to replace "smart quotes" in a files with regular ascii quotes.
This command worked for me:
tr '\222' \' < infile > outfile
(222 is octal for the right single quote)
But then I realized that I have to replace the quote with backslash-quote. The tr command only works to replace one character. And the sed command doesn't seem to work with \222.
Any suggestions?
I had the idea to use the tr command to convert the smart-quote to another character, and then use the sed command to replace that character with \' but there is no character on the keyboard that isn't already being used in the file.
Thanks.
|