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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data extract supression

Status
Not open for further replies.

mart10

MIS
Nov 2, 2007
394
GB
I am using CR 10

I have a field which will allways be populated by the template:

BIBENT:;
BBMINTID:;
BBMBACSID:;
BIBTDP:;
BIPOIN:;
BIPLIM:;
DDOIN:;

I have a formula for each piece of data I need to extract eg:

extractstring({T320.F320X2},"DDOIN:",";")

This works except if there is no data in the field then it extracts a , Supression of , is no good as I am exporting the data to Excel. How can I supress the return of a , in the formuala?
 
stringvar x := {T320.F320X2};
stringvar y := extractstring(x,"DDOIN:",";");
if mid(x,instr(x,"DDOIN")+6,1) = ";" then
"" else
y;

...where 6 should be replaced by the number of characters before the ";" (including the ":").

I was surprised to see that when using extractstring, if there are no characters between the delimiters :) and ; in this case), the function ignored the first ";" as a delimiter and returned it and the remainder of the string up to the next instance of ";". The above formula addresses this.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top