cancel
Showing results for 
Search instead for 
Did you mean: 

Extract Spcific text from a column and store it

former_member193430
Participant
0 Kudos

I want to extract the highlight numbers starting with '22xxxxxx' using BODS out.

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member187605
Active Contributor
0 Kudos

A simple solution that always works, independently from the position of the number in the string:

regex_replace(regex_replace( ItemText, '^.*22', '22'),' .*','')

rajan_burad
Active Participant
0 Kudos

Hi Muhammad,

Extraction is your resultant column and code for this mapping is:

rtrim_blanks( 
ltrim_blanks( 
substr( 
(substr( TC.itemtext,index( TC.itemtext,22,1),length( TC.itemtext))),1,
index( 
substr( TC.itemtext,index( TC.itemtext,22,1),length( TC.itemtext)),' ',1)-1)))

Final result:

Let us know if it helps!

Thanks,

Rajan 🙂