Forum Discussion
Anonymous
4 years agoNot applicable
Remove certain words from text column using column2
remove certain strings from the column Input Input output Hi I am having issue with this product am Hi I having issue with this product Error product live Monday dumm cool cool Error ...
- 4 years ago
You can leverage the List.ReplaceMatchingItems function with Table.AddColumn.
Words to Remove
let //Read in original data Source = Excel.CurrentWorkbook(){[Name="InputData"]}[Content], #"Changed Type" = Table.TransformColumnTypes(Source,{{"Input", type text}}), //Read in list of words to remove Source2 = Excel.CurrentWorkbook(){[Name="removeWords"]}[Content], RemoveWords = Source2[Input], //Add column with the words to remove replace by null #"Remove Words" = Table.AddColumn(#"Changed Type", "Output", each Text.Combine( List.ReplaceMatchingItems( Text.Split([Input]," "), List.Transform(RemoveWords, each {_, null})), " ")) in #"Remove Words"
ronrsnfld
4 years agoSuper User
You can leverage the List.ReplaceMatchingItems function with Table.AddColumn.
Words to Remove
let
//Read in original data
Source = Excel.CurrentWorkbook(){[Name="InputData"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Input", type text}}),
//Read in list of words to remove
Source2 = Excel.CurrentWorkbook(){[Name="removeWords"]}[Content],
RemoveWords = Source2[Input],
//Add column with the words to remove replace by null
#"Remove Words" =
Table.AddColumn(#"Changed Type", "Output",
each Text.Combine(
List.ReplaceMatchingItems(
Text.Split([Input]," "),
List.Transform(RemoveWords, each {_, null})),
" "))
in
#"Remove Words"