Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CR XI - Pattern Match 100 mg/ml

Status
Not open for further replies.

ReportDr00

IS-IT--Management
Mar 2, 2007
194
US
Hello,

I have below data in a field and i would like to extract 100 mg/ml from it
field data desired output
drugname 10 mg/ml testname 10 mg/ml
drug23 name test 0.1 unit/ml name 123 0.1 gram/ml

is there pattern to match to use or other way of accomplishing it?
Appreciate the guidance

Regards
 
Not quite sure what you're asking. Pattern searching is easy, if you only want records with that particular text you can put this in your select formula:

"100mg/ml" in {table.field}
 
and if its the dosage you always want to remove from the string .. is it always consistent? For example is there always a "/" and proceeded by a numeric value?

_____________________________________
Crystal Reports XI Developer Version
Intersystems Cache 5.X ODBC connection

 
If so this would work as long as there is never a "/" in the name of the drug. If so we have to work something else out....

local stringvar array s := split({datafield});
local numbervar a;
local stringvar desired;
for a := 2 to ubound(s) do
if instr(s[a],"/") > 0 then desired := s[a-1] +" "+ s[a];
a;
desired

_____________________________________
Crystal Reports XI Developer Version
Intersystems Cache 5.X ODBC connection

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top