Forum Discussion
How to Remove special character from Alphanumeric character
- 2 years ago
Hi aqeel_shaikh, check this.
Result
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WioiM0jXUdXR2UYrViVYyNDLWNTE10wWKKsXGAgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]), Ad_Cleaned = Table.AddColumn(Source, "Cleaned", each [ lst = {"0".."9"}, a1 = Splitter.SplitTextByCharacterTransition(each true, (x)=> not List.Contains(lst, x))([Column1]), a2 = Text.Combine(List.RemoveItems(a1, {"-"})), b1 = Splitter.SplitTextByCharacterTransition((x)=> not List.Contains(lst, x), each true)(a2), b2 = Text.Combine(List.RemoveItems(b1, {"-"})) ][b2], type text) in Ad_Cleaned - 2 years ago
Try this:
let Source = Excel.Workbook(File.Contents("C:\Users\s441801\OneDrive - Emirates Group\General - AQEEL\Power query\POWER Q TEST SAMPLE.xlsx"), null, true), Sheet1_Sheet = Source{[Item="Sheet1",Kind="Sheet"]}[Data], Ad_Cleaned = Table.AddColumn(Sheet1_Sheet, "Cleaned", each [ lst = {"0".."9"}, a1 = Splitter.SplitTextByCharacterTransition(each true, (x)=> not List.Contains(lst, x))([Column1]), a2 = Text.Combine(List.RemoveItems(a1, {"-"})), b1 = Splitter.SplitTextByCharacterTransition((x)=> not List.Contains(lst, x), each true)(a2), b2 = Text.Combine(List.RemoveItems(b1, {"-"})) ][b2], type text) in Ad_Cleaned
Hi aqeel_shaikh, check this.
Result
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WioiM0jXUdXR2UYrViVYyNDLWNTE10wWKKsXGAgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
Ad_Cleaned = Table.AddColumn(Source, "Cleaned", each
[ lst = {"0".."9"},
a1 = Splitter.SplitTextByCharacterTransition(each true, (x)=> not List.Contains(lst, x))([Column1]),
a2 = Text.Combine(List.RemoveItems(a1, {"-"})),
b1 = Splitter.SplitTextByCharacterTransition((x)=> not List.Contains(lst, x), each true)(a2),
b2 = Text.Combine(List.RemoveItems(b1, {"-"}))
][b2], type text)
in
Ad_Cleaned
- aqeel_shaikh2 years agoHelper III
getting below error
let
Source = Excel.Workbook(File.Contents("C:\Users\General \Power query\POWER Q TEST SAMPLE.xlsx"), null, true),
Sheet1_Sheet = Source{[Item="Sheet1",Kind="Sheet"]}[Data],
#"Changed Type" = Table.TransformColumnTypes(Sheet1_Sheet,{{"Column1", type text}}),
Ad_Cleaned = Table.AddColumn(Source, "Cleaned", each
[ lst = {"0".."9"},
a1 = Splitter.SplitTextByCharacterTransition(each true, (x)=> not List.Contains(lst, x))([Column1]),
a2 = Text.Combine(List.RemoveItems(a1, {"-"})),
b1 = Splitter.SplitTextByCharacterTransition((x)=> not List.Contains(lst, x), each true)(a2),
b2 = Text.Combine(List.RemoveItems(b1, {"-"}))
][b2], type text
in
#"Changed Type"- dufoq32 years agoCommunity Champion
Try this:
let Source = Excel.Workbook(File.Contents("C:\Users\s441801\OneDrive - Emirates Group\General - AQEEL\Power query\POWER Q TEST SAMPLE.xlsx"), null, true), Sheet1_Sheet = Source{[Item="Sheet1",Kind="Sheet"]}[Data], Ad_Cleaned = Table.AddColumn(Sheet1_Sheet, "Cleaned", each [ lst = {"0".."9"}, a1 = Splitter.SplitTextByCharacterTransition(each true, (x)=> not List.Contains(lst, x))([Column1]), a2 = Text.Combine(List.RemoveItems(a1, {"-"})), b1 = Splitter.SplitTextByCharacterTransition((x)=> not List.Contains(lst, x), each true)(a2), b2 = Text.Combine(List.RemoveItems(b1, {"-"})) ][b2], type text) in Ad_Cleaned- aqeel_shaikh2 years agoHelper III
dufoq3 Thanks for the solution. Much appreciated😊