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!

Crystal Reports 2008, Oracle 11g -Parse Notes Field, retrieve multiple results between text patterns

Status
Not open for further replies.

hmax

Programmer
Jan 22, 2012
60
US
Crystal Reports 2008
Oracle 11g


Notes field contains, e.g.:

"Person Name:John
Company Name: CompanyABC
Call back number: 999 999 9999
Site ID: XYZ1234
Begin Time:
Description: This is what happened

Open Hours: 5:00am-12:00am

3:54 PM 3/30/1930
took this action

4:02 PM 3/30/1930
took another action
and did this also

4:11 PM 3/30/1930
finished up and provided
the sign off"

There appears to be consistency in the field items, although this is not confirmed. So, every Notes field should have

Person Name: xxxx
Company Name: xxxx
and so on

So, I want to retrieve results between items, let's say I want to retrieve
John
this result comes between

Person Name: (result of "John") hard return to next line
Company Name:


Next, I might want to retrieve the result between
Description: (seem to be two hard returns here)
Open Hours:

And so on.

How do I do this, please?

Thank you,

hmax

 
i do not have crystal in front of me at the moment and it has been one of those weeks so far, so i apologize for any errors or misunderstandings on my part.

i would create a formula for each item you want to retrieve.
Something like:
{@Name}
numbervar ns1 := instr({table.field},"Person Name:");
numbervar ns2 := instr({table.field},"Company Name:");
IF ns > 0 and ns2 > 0 then MID({table.field},ns1+13,ns2-1)
 
That's great, fisheromacse, thank you!

What if I had a scenario like the one below?

So, I want to capture "5:00am-12:00am" which comes immediately after "Open Hours:" but then we have a hard return at the end of the line and then another 1 or 2 hard returns and then the next line filled in shows "3:54 PM 3/30/1930" but this is not a consistently filled in result, it could change.

Therefore, I will want to capture everything between "Open Hours:" and the end of the line before the first hard return, yes? Or, everything between "Open Hours:" and the next instance of a character??? How do I do this, please?


===
Open Hours: 5:00am-12:00am

3:54 PM 3/30/1930
took this action
===


Grateful for your help!

Tks,
hmax
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top