I need to search and replace all occurences of an unknown character in some files having the same name.
Opening such files with vi, I read <91> code for that character. Opening them with nano, I read a "question mark" in a diamond (black rhumble).
I would like to replace such unknown character with a quote ('). I'm trying many ways with no luck.
I tried:
find ./ -name filename.txt -exec perl -i~ -pe "s/\x91/'/" {} \;
find ./ -name filename.txt -exec sed -i "s/\x91/'/g" {} \;
EDIT More info on the character:
Hexadecimal: 91 68 74 74
Decimal: 145 104 116 116
Octal: 221 150 164 164
Binary: 10010001 01101000 01110100 01110100
LC_ALL=C sed -n l < file
\221
If you need more, ask!
sed -i "s/\x91/'/g"
on thatfile
not work? – Stephane Chazelas Feb 21 at 9:42