Quantcast
Channel: SCN : Unanswered Discussions - Data Services and Data Quality
Viewing all articles
Browse latest Browse all 3719

Need Numerics as output, from an irregular expression (string)

$
0
0

Hi all,

 

I am working in SAP BODS, I have a requirement like from the chemical composition data, I have extract the numeric values.
The special cases I have are as follow:

 

 

EZETIMIBE SIMVASTATIN TABLETS 10/10 MG

CB 25,50 & 100MG CAN

CB FOR AMBRISENTAN TAB 5 AND 10MG STRA2

COLESEVELAM (ORAL SUSP 1.875 & 3.750G)CB

1 mg

100 mg

 

I need output as:

 

10/10
25/50/100
5/10
1.875/3.750
1
100

 

This is an Emergency requirement in my project, Please suggest.
I have tried custom function like this:

 

$L_String ='CINACALCET HCL TABS 60MG BLEND';

$L_String_Length =length( $L_String );

$L_Counter =1;

$L_String_final =null;

 

while($L_String_Length>0)

begin

$L_Char =substr( $L_String ,$L_Counter,1);

 

if(ascii($L_Char)>=46 and ascii($L_Char)<=57)

begin

$L_String_final =$L_String_final||$L_Char;

$L_Counter =$L_Counter+1;

$L_String_Length =$L_String_Length-1;

end

 

else

 

begin

$L_Counter =$L_Counter+1;

$L_String_Length = $L_String_Length-1;

end

end

 

 

print( $L_String);

print( $L_String_final);


It is working for few simple cases, but not for all the cases.

Waiting for a solution!!


Viewing all articles
Browse latest Browse all 3719

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>