Parsing/Extract part of a String?
Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22450
Printed Date: 03 May 2024 at 11:05am
Topic: Parsing/Extract part of a String?
Posted By: cbaldwin
Subject: Parsing/Extract part of a String?
Date Posted: 12 Sep 2017 at 9:52am
I am needing to extract part of a string. An example of the content of the string in my field is listed below. The field name is Command.Description.
RED BLOOD CELLS|CPD>AS1/500mL/refg|Irradiated|ResLeu:<5log6
I need to extract what comes after the first"|" and before the first "/" character. In this case i want the result of my formula to equal "CPD>AS1"
Note that the number of characters and spaces preceding the first "|" is variable and that the number of characters and spaces proceeding the first "/" is variable. Also the number of characters in between is variable.
I have never tried doing this before with crystal, therefore i don't really even know where to begin.
My ultimate goal is to determine the number of characters between the first"|" and the first"/".
Thanks in advance for any help.
|
Replies:
Posted By: DBlank
Date Posted: 12 Sep 2017 at 10:07am
mid({Command.Description},instr({Command.Description},"|")+1,instr({Command.Description},"/")-instr({Command.Description},"|")-1)
|
Posted By: cbaldwin
Date Posted: 12 Sep 2017 at 10:27am
|