OpenRefine Remove Accents

35 views Asked by At

Is there an easy way to replace accents?

I have been using this formula:

value.replace("á","a").replace("Í", "Í").replace("ó","o")
1

There are 1 answers

0
Tom Morris On

There's not a good way to do this simply using GREL, but you can switch your expression language to Python and use this:

import unicodedata

return ''.join(c for c in unicodedata.normalize('NFD', value)
                  if unicodedata.category(c) != 'Mn')