Forum Discussion
Anonymous
4 years agoNot applicable
getting words that contains diacritics from text
Hi, I have a column with names. Names sometimes consist of several words and I need to extract only the words that have diacritics. For example, from the 1st row "Bühnen/Buehnen/Buhnen", I need to ge...
- 4 years ago
Just use Text.Combine additionally.
NamePartsWDiacriticsOnly = Table.AddColumn(ConvertedNamePartsToList, "Name Parts with Diacritics", each try Text.Combine(List.Select([Name Parts], (x)=>List.ContainsAny(Text.ToList(x),DiacriticsList, Comparer.OrdinalIgnoreCase)),", ") otherwise null)Regarding words part, I will come back later as I am trying to have a one line solution for words matching rather than character matching.
Vijay_A_Verma
Most Valuable Professional
4 years agoReplace the statement before in with this
NamePartsWDiacriticsOnly = Table.AddColumn(ConvertedNamePartsToList, "Name Parts with Diacritics", each try List.Select([Name Parts], (x)=>List.ContainsAny(Text.ToList(x),DiacriticsList, Comparer.OrdinalIgnoreCase)){0} otherwise null)Anonymous
4 years agoNot applicable
Thank you very much Vijay_A_Verma,
it really solved the problem at hand. Interesting workaround - split the text into individual characters and then check whether any of the diacritics characters are there!
Still, I am curious how could this be handled if I needed to look for substrings, not just for single characters.
Let's say I would like to search also for words where the diacritics were transcribed into multiple ANSI characters. For example, if the DiacriticsList would look like this:
DiacriticsList = List.Buffer({"ö", "ü", "oe", "ue"})Any ideas how this could be handled?