Parsing names from email address book

General support questions.
Posts: 1
Joined: Fri Jan 06, 2006 12:11 pm
Location: Vergennes, VT
PostPosted: Fri Jan 06, 2006 12:20 pm
I am trying to find the best way to pull names from an email address export file. The names are exported and look like this:
"John Smith" <[email protected]>
I want to place the data into first name, last name , and email fields. I've been playing around using patterncount but an going in bigger and bigger circles. Any help will be most appreciated.

Bob O
Bob Owens
ANWSU
48 Green St.
Vergennes, VT 05491
SeedCode Staff
SeedCode Staff
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am
PostPosted: Fri Jan 06, 2006 1:26 pm
bowensvt wrote:I am trying to find the best way to pull names from an email address export file. The names are exported and look like this:
"John Smith" <[email protected]>
I want to place the data into first name, last name , and email fields. I've been playing around using patterncount but an going in bigger and bigger circles.


My mind goes to Substitute() instead of Patterncount(). The following is set to return Email, but you can use it to extract any of the variables declared in the Let() statement. Kind of crude on middle names, but you get the idea.
Code: Select all
Let ( [
string = YourFieldName ;
sName = Substitute ( Left ( string ; Position ( string ; "<" ; 1; 1 ) - 1 ) ; """ ; "" ) ;
sNameFirst = LeftWords ( sName ; 1 ) ;
sNameLast = Substitute ( sName ; sNameFirst & " " ; "" ) ;
sEmail = Substitute ( string ; [ "<" ; "" ] ; [ ">" ; "" ] ; [ """ ; "" ] ; [ sName ; "" ] )
] ;

sEmail

)
John Sindelar
SeedCode

Return to General Support

Who is online

Users browsing this forum: No registered users and 3 guests

(855) SEEDCODE
[email protected]
Follow us: