Forum Discussion
monojchakrab
Resolver III
3 years agoHow to isolate text or numbers trailing a particular text string
Hey good people, I am trying to get the pack number from a table as below : Towards this end, I wrote a code as below, which works part of the way : if Text.Contains([Title],"pack"...
- 3 years ago
Test this and let me know if there is any exception. If yes, I will need that data where you get exception
try Number.From(Text.Split(Text.Split([Title],"Pack of"){1}," "){1}) otherwise 1
Anonymous
3 years agoNot applicable
You can just use "of " and " |" as delimiters, since as you know,
Text.BetweenDelimiters(text as nullable text, startDelimiter as text, endDelimiter as text, optional startIndex as any, optional endIndex as any) as any
So = Table.AddColumn(PriorStepOrTableName, "Quantity", each Text. Between Delimiters([ColumnName], "of ", " |"), type text)
But listen, it appears that this is a table with one column. But if "Title" is the name of your single table column, then you are good.
--Nate