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!

Find email address in concatenated string 1

Status
Not open for further replies.

fxsage

Programmer
Sep 9, 2002
21
US
How can I find a single email address in a string of concatenated email addresses that is stored in a memo field?

I want to be able to edit a single address anywhere in this string and replace it with a revised address.

Thanks
 
fxsage

Can you give an example of what the string would look like?

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Here is an example of the string construction, much shortened in length:

arwefive@areeeeve.com; arewwaad@nerscape.net; anitamprice@aol.com; andwewvg@yorrcenter.org; alsmxzh@lutwwran-hosw.com; alpenrod@ebsu.edu; ajacozz@vizu.exu;
 
Look up STRTRAN() and REPLACE command in the help file...it would be used similar to this:

Code:
REPLACE MyMemo WITH STRTRAN(MyMemo, "anemail@anisp.com", "areplacement@adiffisp.com") in "MyTable"

...where MyMemo is the name of your memo field, anemail@anisp.com is the email that is currently in the field and areplacement@adiffisp.com is the new modified email addy, and MyTable is the name of your table/alias.

Slighthaze = NULL
craig1442@mchsi.com
"Whom computers would destroy, they must first drive mad." - Anon​
 
fxsage

If you do not know which email address you want to edit, you may need to parse the memo field to extract all the email addresses into a two field cursor, MYCURSOR, with fields, MYCURSOR.before C(254) and MYCURSOR.after C(254).

If both fields initially have the same values, ie the email address, you can then loop through the cursor and edit the MYCURSOR.after field.

Once done, SCAN FOR MYCURSOR.before # MYSCURSOR.after...ENDSCAN on the cursor, and within the loop apply the code as suggested by slighthaze.

FAQ184-2483 - the answer to getting answered.​
Chris [pc2]
 
Slighthaze. Thanks for the expertise. Much easier than
I expected.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top