Forum Discussion
wad11656
3 years agoAdvocate I
Text.Combine() with incrementing (numerical) delimiter
Is there a way to make Text.Combine() use an incrementing delimiter? For example, change the "||" below to an incrementing number that starts from 1? {"NamesColumn (Combined)", each Text.Combine...
- 3 years ago
Hi wad11656 ,
yes, this can be done with the List.Zip-function:let Source = {"Betty", "Mark", "John", "Alice"}, ListWithNumbers = {1 .. List.Count(Source)}, FormattedListWithNumbers = List.Transform(ListWithNumbers, each "(" & Text.From(_) & ") "), ZipAndExpand = List.Combine(List.Zip({FormattedListWithNumbers, Source})), ToText = Text.Combine(ZipAndExpand, " ") in ToText
ImkeF
3 years agoCommunity Champion
Hi wad11656 ,
yes, this can be done with the List.Zip-function:
let
Source = {"Betty", "Mark", "John", "Alice"},
ListWithNumbers = {1 .. List.Count(Source)},
FormattedListWithNumbers = List.Transform(ListWithNumbers, each "(" & Text.From(_) & ") "),
ZipAndExpand = List.Combine(List.Zip({FormattedListWithNumbers, Source})),
ToText = Text.Combine(ZipAndExpand, " ")
in
ToText