Karen
Could you try something like this it should work with or without the comma
************************
SET VAR vLen INTEGER = 0
SET VAR vLoc INTEGER = 0
SET VAR vRem INTEGER = 0
SET VAR vEMail TEXT = NULL
SET VAR vEmail1 TEXT = NULL
--SET VAR vEMail1 = ('tellef, karen <[email protected]>')
SET VAR vEMail1 = ('karen tellef <[email protected]>')
IF vEMail1 CONTAINS '<' THEN
SET VAR vLen = (SLEN(vEMail1))
SET VAR vLoc = (SLOC(.vEmail1,'<'))
SET VAR vRem = (.vLen - .vLoc)
SET VAR vEMail = (SGET(.vEMail1,(.vRem -1),(.vLoc +1)))
ENDIF
SHOW VAR vEMail
****************************
Buddy
From: [email protected] <mailto:[email protected]> [mailto:[email protected]]
On Behalf Of Karen Tellef
Sent: Thursday, October 22, 2015 12:45 PM
To: Richardson, Jeff <[email protected] <mailto:[email protected]> >
Subject: [RBASE-L] - Help with parsing email addresses?
Converting older RMail code into new RMail code. One of the things I have to
do is parse email addresses into individual RMail commands. I have no real
control over how it's getting to me.
If all data was like this, I could obviously parse using SSUB:
[email protected] <mailto:[email protected]> , [email protected]
<mailto:[email protected]>
Some of the data comes in with the "names" as part of the address. Again, this
would be easy, use SSUB
karen tellef <[email protected] <mailto:[email protected]> >, mary smith
<[email protected] <mailto:[email protected]%0b%0bBut%20guess%20what...
%20Some%20of%20the%20names%20actually%20have%20a%20comma%20embedded:%0b
%20tellef,%20karen%20%[email protected]>
But guess what... Some of the names actually have a comma embedded:
tellef, karen <[email protected]>, mary Smith <[email protected]
<mailto:[email protected]> >
Sigh... Any suggestions on how I could program to get this into 2 lines for
an RMail send?
Thanks much!
Karen