I have a file containing many vowels with diacritics. I need to make these replacements:
You can use man iso_8859_1
(or your char set) or od -bc
to identify the the octal representation of the diacritic. Then use gawk
to do the replacing.
{ gsub(/\344/,"a"; print $0 }
This replaces ä
with a
.
For this the tr(1) command is for. For example:
tr 'āáǎàēéěèīíǐì...' 'aaaaeeeeiii...' <infile >outfile
You may have to check/change your LANG
environment variable to match the character set being used.
This might work for you:
sed -i 'y/āáǎàēéěèīíǐìōóǒòūúǔùǖǘǚǜĀÁǍÀĒÉĚÈĪÍǏÌŌÓǑÒŪÚǓÙǕǗǙǛ/aaaaeeeeiiiioooouuuuüüüüAAAAEEEEIIIIOOOOUUUUÜÜÜÜ/' file