LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-09-2012, 02:57 PM   #1
kitonia
LQ Newbie
 
Registered: Oct 2012
Posts: 1

Rep: Reputation: Disabled
How to remove accent characters


Does anyone know the command remove the accent characters? For example, I would like the name Rene to be Renee
 
Old 10-09-2012, 04:41 PM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
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 Rene | sed 's//e/'
but if you want to do this for every accented character, umlaut, caron, etc. etc. in text files, you need to write down a sequence of long character lists, e.g.
Code:
sed -e 's/[]/e/' -e 's/[]/a/' ...
A more convenient way is by means of the iconv command to change the character encoding from UTF-8 to ASCII and transliterate the special characters so that become e, becomes o and so on. Example:
Code:
echo Rene | iconv -f UTF-8 -t ASCII//TRANSLIT
or if you want to change the content of a file:
Code:
iconv -f UTF-8 -t ASCII//TRANSLIT infile > oufile
Hope this helps.
 
Old 06-07-2013, 05:43 PM   #3
arbex5
LQ Newbie
 
Registered: Jul 2012
Location: Brazil
Distribution: Ubuntu
Posts: 17

Rep: Reputation: Disabled
There is a simple way

Just use the command unaccent.

$ unaccent ISO-8859-1 < myfile > myfile.unaccent

Worked like a charm to me.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
remove particular characters using sed dsids Linux - Software 7 12-14-2010 01:10 AM
French accent characters in email 3speed Linux - Software 0 01-09-2006 12:17 PM
remove characters in c alaios Programming 2 07-10-2005 11:10 AM
printing Spanish accent characters in Perl/tk entry widget puedo Programming 1 02-19-2005 02:16 PM
Question about accent characters, etc in Openoffice.org LaptopLinux Linux - Software 1 07-25-2004 10:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration