Accent to plain character replacement

Help with writing and playing macros

Accent to plain character replacement

Postby davidp » Fri Oct 19, 2012 10:45 am

Would anyone have a replacement formula that would convert all the accented characters (umlaut, accent, accent grave, tilde, etc.) in a text to their equivalent unaccented characters?
User avatar
davidp
Newbie
 
Posts: 3
Joined: Wed Aug 04, 2004 11:00 pm

Re: Accent to plain character replacement

Postby Mofi » Fri Oct 19, 2012 11:27 am

That cannot be done with a single replace. You need a macro or script for this task like the macro below. The macro property Continue if search string not found must be checked for this macro.

Code: Select all
InsertMode
ColumnModeOff
HexOff
Top
UnixReOff
Find MatchCase "ƒ"
Replace All "f"
Find MatchCase "Š"
Replace All "S"
Find MatchCase "Ž"
Replace All "Z"
Find MatchCase "š"
Replace All "s"
Find MatchCase "ž"
Replace All "z"
Find MatchCase RegExp "[ŸÝ]"
Replace All "Y"
Find MatchCase RegExp "[ÀÁÂÃÄÅÆ]"
Replace All "A"
Find MatchCase "Ç"
Replace All "C"
Find MatchCase RegExp "[ÈÉÊË]"
Replace All "E"
Find MatchCase RegExp "[ÌÍÎÏ]"
Replace All "I"
Find MatchCase "Ñ"
Replace All "N"
Find MatchCase RegExp "[ÒÓÔÕÖ]"
Replace All "O"
Find MatchCase RegExp "[ÙÚÛÜ]"
Replace All "U"
Find MatchCase "ß"
Replace All "ss"
Find MatchCase RegExp "[áàâãäåæ]"
Replace All "a"
Find MatchCase "ç"
Replace All "c"
Find MatchCase RegExp "[èéêë]"
Replace All "e"
Find MatchCase RegExp "[ìíîï]"
Replace All "i"
Find MatchCase "ñ"
Replace All "n"
Find MatchCase RegExp "[òóôõö]"
Replace All "o"
Find MatchCase RegExp "[ùúûü]"
Replace All "u"
Find MatchCase RegExp "[ýÿ]"
Replace All "y"

I created this macro using View - Views/Lists - ASCII Table. Some special characters like those for ETH and THORN are not included in this macro as I don't know which are the ASCII letters for those characters.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4049
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna


Return to Macros