Karen:
It seems like the variably embedded comma is the bottleneck to the SSUB solution. Drawing upon Jeff Richardson’s earlier post, why not SRPL the embedded comma to a really unlikely string like ‘~~” (double tilde), let SSUB do it’s magic, then SRPL the comma back into play when you’ve rendered it harmless? Bruce Chitiea SafeSectors, Inc. 909.238.9012 mobile From: [email protected] [mailto:[email protected]] On Behalf Of Karen Tellef Sent: Friday, October 23, 2015 6:42 AM To: [email protected] Subject: [RBASE-L] - RE: Help with parsing email addresses? I should have mentioned that for now we've decided on a solution. In most of the cases, using a simple SSUB will extract the email addreses. The only thing that SSUB doesn't work on is if a comma is embedded in the name: "tellef, karenf" < <mailto:[email protected]> [email protected]>, <mailto:[email protected]> [email protected] In the above case, a SSUB(...1) would extract just the word "Tellef". So I just test that the result contains a "@" and if it doesn't just throw it away. The SSUB(..2) would extract just "karen" as the name and they're fine with that. I could have added code for the SSUB(...1) so get characters from the first ", but they said not to bother right now. We're going to update the list of frequent emails to get rid of those commas and add code to prevent it from happening in the future. Karen -----Original Message----- From: Karen Tellef < <mailto:[email protected]> [email protected]> To: rbase-l < <mailto:[email protected]> [email protected]> Sent: Fri, Oct 23, 2015 8:28 am Subject: Re: [RBASE-L] - RE: Help with parsing email addresses? Well yes and no. I actually want to KEEP the "name", not parse out just the address. And actually the data is more complicated than what I posted because I wanted to focus on one issue. The problem is that the app (written by someone else) allows them to (a) type in email addresses freehand, and/or (b) select them from a list of frequent emails that sometimes have a name and sometimes do not. So for example, my string can have values like below. I need to extract individual addresses and they want me to keep the "name". This wasn't an issue in RMail for 7.6 because we sent them all on one line, but the newer RMail requires each address on a different line. I might suggest that we totally redo the method of them selecting an address. We can't upgrade until I have RMail code redone so I have some time to wrestle with this. <mailto:[email protected]> [email protected] <mailto:[email protected]> [email protected], <mailto:[email protected]> [email protected] "karen tellef" < <mailto:[email protected]> [email protected]> "karen tellef" < <mailto:[email protected]> [email protected]>, <mailto:[email protected]> [email protected] Nice data, huh?? I need to be off the allergic meds to tackle this one! Karen -----Original Message----- From: Buddy Walker < <mailto:[email protected]> [email protected]> To: karentellef < <mailto:[email protected]> [email protected]> Sent: Thu, Oct 22, 2015 6:34 pm Subject: [RBASE-L] - RE: Help with parsing email addresses? 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 < <mailto:[email protected]> [email protected]>') SET VAR vEMail1 = ('karen tellef < <mailto:[email protected]> [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: <mailto:[email protected]> [email protected] [ <mailto:[email protected]> mailto:[email protected]] On Behalf Of Karen Tellef Sent: Thursday, October 22, 2015 12:45 PM To: Richardson, Jeff < <mailto:[email protected]> [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: <mailto:[email protected]> [email protected], <mailto:[email protected]> [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 < <mailto:[email protected]> [email protected]>, mary smith < <mailto:[email protected]%0b%0bBut%20guess%20what... %20Some%20of%20the%20names%20actually%20have%20a%20comma%20embedded:%0b %20tellef,%20karen%20%[email protected]> [email protected] But guess what... Some of the names actually have a comma embedded: tellef, karen <[email protected]>, mary Smith < <mailto:[email protected]> [email protected]> Sigh... Any suggestions on how I could program to get this into 2 lines for an RMail send? Thanks much! Karen

