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

Crystal Reports: Extract value for a String

Status
Not open for further replies.

jarrodj74

IS-IT--Management
Jun 18, 2013
1
0
0
US
I have a CUD String that is being passed to me and I need to extract variables from it based on the prefix they start with.
name of string: {EZ_CONFIGURED_LINE_ITEM.CUD_STRING}
Data inside CUD_String (the following is just a small section as an example its an extremely long string)


USBottomLoadAdapters='Civacon891A',USPipeCouplers='Dixon; aluminum; 4in; Viton-A Gasket',USPipingBrakeInterlock='Bar interlock with castings; civacon valve',USPipingSystem='4in Piping',USPipingSystemValve='None',

I want to display the value for USPipcouplers

which is: 'Dixon; aluminum; 4in; Viton-A Gasket

What would this formula look like? I'm a Newby to Crystal Reports!
 
it's been a while for me coding for crystal, but I believe you'd need to start with instr function.

some code something like this - I am sure I have some typos:

local numbervar startofstring1;
startofstring1:=instr(USPipcouplers=)+15
(the 15 is to get you to the start of the string you really want)

then something like:
right(your string, startofstring1) should give you all of the string starting with Dixon.

then if the output you want consistently ends at the first single quote, you could use the left function, to remove that and everything past it... There are some examples out there if you google on it. And I'm sure folks here could correct my vague answer.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top