Forum Discussion
Remove text between delimiters
- 6 years ago
Hi Anonymous ,
You can create a column with the bolded code - if you paste the full code into the advanced editor you'll have a complete solution:
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcspJVIBhcx/PENcgpVidaKUkINcUzFUoSa0oARNgCaC6JAWgJFzABEkVUBdMkYKJngFCBiwaAlWiABY3NQCzkQ0GCxgZG+sZo5qpYGiA4ZRYAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [#"Product input" = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"Product input", type text}}), #"Added Custom" = Table.AddColumn( #"Changed Type", "Custom", each Text.Combine( List.Select( Text.Split([Product input], " "), (x) => not Text.Contains(x, "liter", Comparer.OrdinalIgnoreCase)), " ")) in #"Added Custom".. unfortunately the new editor doesn't let me highlight parts of the code anymore - this is the code that goes into the "Table-Add-column-Window":
Text.Combine(
List.Select(
Text.Split([Product input], " "),
(x) => not Text.Contains(x, "liter", Comparer.OrdinalIgnoreCase)),
" ")
Yes such a solution would indeed do the trick!
Hi Anonymous ,
You can create a column with the bolded code - if you paste the full code into the advanced editor you'll have a complete solution:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcspJVIBhcx/PENcgpVidaKUkINcUzFUoSa0oARNgCaC6JAWgJFzABEkVUBdMkYKJngFCBiwaAlWiABY3NQCzkQ0GCxgZG+sZo5qpYGiA4ZRYAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [#"Product input" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Product input", type text}}),
#"Added Custom" =
Table.AddColumn(
#"Changed Type",
"Custom",
each Text.Combine(
List.Select(
Text.Split([Product input], " "),
(x) => not Text.Contains(x, "liter", Comparer.OrdinalIgnoreCase)),
" "))
in
#"Added Custom"
.. unfortunately the new editor doesn't let me highlight parts of the code anymore - this is the code that goes into the "Table-Add-column-Window":
Text.Combine(
List.Select(
Text.Split([Product input], " "),
(x) => not Text.Contains(x, "liter", Comparer.OrdinalIgnoreCase)),
" ")
- Anonymous6 years agoNot applicable
ImkeF that works perfectly, thanks so much for your help!
BTW, are there any books or courses you'd recommend to become better at writing M?
RegardsBas