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

Extracting specific text from text field

Status
Not open for further replies.

WilmDel

MIS
Oct 19, 2007
3
US
I am a new member and hoping that someone can help me...

I am trying to extract specific text from a large text field that may or may not contain the text I am looking for. I want to extract the text that follows the following string "Purpose:" Purpose can show up at any location within the text string. I have created a formula in Excel that works, but I have not had any luck in Business Objects.

Here is an example of the excel formula...

=MID(cell address,SEARCH("purpose",cell address,1),200)

Thanks!

 
Wilmdel

If you want to include the word "purpose", take out "+7" below:

numbervar pos := instr(ucase({table.field}),"PURPOSE");
if pos = 0 then
""
else
MID({table.field},pos+8)

Andy
 
Thank you Andy, unfortunately, I am using Business Objects Web Intelligence XI Release 2, and instr, ucase, and mid are not available functions that I am aware of....
 
Thanks for your assistance. I will give it a try...
 
Hi, I'm using CR9 and I'm trying to pull the names of a people out of a large text field. The people are referenced in quotes. Example: The order is for (Sam Smith) on the date of 1/1/2001. Is there an easy way to do this?

So far I've tried this formula:
@Person
whileprintingrecords;
trim(split((split({tablename.TEXT},"(")[2]),")")[1])

I get the error: "A Subscript must be between 1 and the size of the array
 
If there is only one person identified in the field per record, then you could use:

extractstring({table.string},"(",")")

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top