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

How to select multiple strings from a memo filed 1

Status
Not open for further replies.

vgibbs

Technical User
Sep 10, 2001
2
AU
Hi,

I have the following text in a memo field and would likke to extract some information from it.
It is a memo field so I need to use the InStr function.

The problem is I can extract the first piece of info using InSr to select the From: and give me the rest of the info on that line, but I then want to find the next From: to extract the info on that line.



From: Gibbs, Vern (PIRSA)
Sent: Wednesday, 30 March 2005 2:06 PM
To: Narfs to EDS (E-mail)
Subject: New user

Please create a new userid.


PIRSA Network Access Request Submission

Require by: 31/03/2005


From: RMCBSC [mailto:BSC@helpdesk.eds.com.au]
Sent: Thursday, 31 March 2005 8:31 AM
To: Gibbs, Vern (PIRSA)
Subject: Re: New user sr # 2724914 (KMM1264753V23306L0KM)


From: Gibbs, Vern (PIRSA) via General Pool for SAG BSC
 
Can't follow your example. If the last line is the result you are expecting to see, it is unclear how the previous sample would lead to that result, i.e., where does "via General Pool fo SAG BSC" come from?

-LB
 
Hi LB,

Thank you for the prompt response.

I would like to extract the information that is in the string starting with From:

A second string starting with From: is also listed in the text and I would also like to get the information that is after this From:

The results would be.

The first From: From: Gibbs, Vern (PIRSA)

The Second From: From: RMCBSC [mailto:BSC@helpdesk.eds.com.au]
 
Try something like:

stringvar array y := split({table.string},"From: ");
numbervar counter;
stringvar z;

for counter := 2 to ubound(y) do(
z := z + "From: "+ split(y[counter],chr(13))[1] + chr(13));
z

You would need to format this to "Can Grow." Or, if you want to reference these inidividually, you could use:

stringvar z;
split(z,chr(13))[1] //or 2

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top