Bulk Replace Each Letter using List.Accumulate() in Power Query (2 Steps)

preview_player
Показать описание
#powerquery #power_query

Syntax
List.Accumulate(list of items to iterate, initial item, (state, current) =˃ state + current)

Advanced Editor Code:

let
Source = null,
T1 = #table(type table [Col1=Text.Type,Col2=Text.Type,Col3=Text.Type],{{"the", "quick", "brown"}, {"fox", "jumps", "over"}, {"the", "lazy", "dog"}}),
T2 = #table(type table[Old = Text.Type, New = Text.Type],{{"a", "ȁ"}, {"b", "ƀ"}, {"c", "ç"}, {"d", "đ"}, {"e", "é"}, {"f", "ƒ"}, {"g", "ĝ"}, {"h", "ĥ"}, {"i", "î"}, {"j", "ĵ"}, {"k", "ķ"}, {"l", "ĺ"}, {"m", "ɱ"}, {"n", "ŋ"}, {"o", "ø"}, {"p", "þ"}, {"q", "ɋ"}, {"r", "ř"}, {"s", "ş"}, {"t", "ţ"}, {"u", "û"}, {"v", "ʋ"}, {"w", "ŵ"}, {"x", "ẋ"}, {"y", "ÿ"}, {"z", "ƶ"}}),
Custom1 = List.Accumulate(
{0..Table.RowCount(T2)-1},
T1,
(table, list)=˃
Table.TransformColumns(table, {}, each Replacer.ReplaceText(_, T2[Old]{list},T2[New]{list})))
in
Custom1
Рекомендации по теме