How to remove accent characters
Does anyone know the command remove the accent characters? For example, I would like the name Renée to be Renee
|
Accented characters are not easy to manage since they are encoded in UTF-8 and they are 2-bytes in size: using octal or hexadecimal codes to match them may become a mess. On the other hand, if you can type them in the command line, you can always translate them literally, e.g.
Code:
echo Renée | sed 's/é/e/' Code:
sed -e 's/[èéêë]/e/' -e 's/[àáâãäå]/a/' ... Code:
echo Renée | iconv -f UTF-8 -t ASCII//TRANSLIT Code:
iconv -f UTF-8 -t ASCII//TRANSLIT infile > oufile |
There is a simple way
Just use the command unaccent.
$ unaccent ISO-8859-1 < myfile > myfile.unaccent Worked like a charm to me. |
All times are GMT -5. The time now is 04:26 PM. |