Forum Discussion
Syndicate_Admin
4 years agoAdministrator
Checking string of certain format
Hey Everyone, I am new to power query and this has had my head scratching is there anyway I can solve this? Is it possible to check a string dynamically where AA****...BB where AA and BB are alp...
- 4 years ago
Use this
= Splitter.SplitTextByCharacterTransition({"0".."9"},{"A".."Z", "a".."z"})(Text.SplitAny([Input],"/-"" """){0}){0}
AlB
4 years agoCommunity Champion
Hi there
Place the following M code in a blank query to see the steps.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcnQyNDI2MTVzclYwNjA2VorVgYkBRYwMjIyUYmMB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}}),
#"Duplicated Column" = Table.DuplicateColumn(#"Changed Type", "Column1", "Column1 - Copy"),
#"Split Column by Character Transition" = Table.SplitColumn(#"Duplicated Column", "Column1 - Copy", Splitter.SplitTextByCharacterTransition({"0".."9"}, (c) => not List.Contains({"0".."9"}, c)), {"Column1 - Copy.1", "Column1 - Copy.2"}),
#"Removed Columns" = Table.RemoveColumns(#"Split Column by Character Transition",{"Column1 - Copy.2"}),
#"Renamed Columns" = Table.RenameColumns(#"Removed Columns",{{"Column1 - Copy.1", "Output"}})
in
#"Renamed Columns"
|
|
Please accept the solution when done and consider giving a thumbs up if posts are helpful. Contact me privately for support with any larger-scale BI needs, tutoring, etc. |