Forum Discussion
Extracting a number string after a two character delimiter
- 1 year ago
Hi m00ch
To better understand the issue and provide an accurate solution, could you share a sample dataset in a .csv or Excel file? This will allow us to analyze the data structure and understand how the CR and LF characters are impacting the results. Please anonymize any sensitive information if necessary before sharing.
Thank you!
m00ch
You may try AddColumn > Extract > Text Between Delimiters:
= Table.AddColumn(Source, "Text Between Delimiters", each Text.BetweenDelimiters([Column1], "T#", " "), type text)
- m00ch1 year agoRegular Visitor
I am sorry, I did not describe that well. The screenshot is the data that is all in one row with Carriage Returns (CR). So using a space as the second delimiter does not seem to work well and if I use clean it removes CR but puts the data of the next line right up against the alphanumeric string that I am trying to get. Which essentially eliminates the second delimiter.
- dufoq31 year agoCommunity Champion
Hi m00ch,
if this code doesn't work with your data. Replace "#(lf)" with "#(cr)"
Output
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("Vc/LCsIwEIXhVxnqVmxmkkllwEVB3Aki7touhEYpaOslRR/fqReocCCb/4NJUSSU+pQMEVgxLOhhsxbI+7qJArsJ2Txjj3PHfs7ss7JNqumAeEAOUDgTdmO06k6n7tG0R+gvcOhu+tT7GGZfaAfI4IWMII7hNlz7cI+h/hOYkvsQK86JycZkqdlCCw2Q37nBVEfGGL0Nh0H+6/U/SLlF0jld2d67c4AYnjGpqhc=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]), Ad_Extracted = Table.AddColumn(Source, "Extracted", each Text.BetweenDelimiters([Column1], "T#", "#(lf)")) in Ad_Extracted