Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

2 email addresses in the same cell

msantoso
8 - Asteroid

hello, 

 

I'm cleaning a customer file in which the email address is stored. 

For many records, there are 2 email addresses separated with a comma, a semi-column, a slash (/) or a dash.

 

I wish to keep only the first email address

 

could you please help me? 

 

thanks 

myraim

8 REPLIES 8
haroon_sa
10 - Fireball

Hi @msantoso

 

Split the email address with Regex tool and use the select tool to keep first email alone.

 

I have attached my solution. Hope it helps.

 

If you have any queries let me know.

msantoso
8 - Asteroid

Hi Haroon_sa

 

thanks for this solution. 

I understand that it creates 2 new columns. 

and I need a new step to select one of them. 

 

Is there any way that removes the second email from the original column? 

 

many thanks

Myraim

haroon_sa
10 - Fireball

Hi @msantoso

 

This solution will make sense. Hope this solution is what you exactly need.

 

If you have any queries let me know.

 2.PNG

 

kat
12 - Quasar

Hi @msantoso

 

Following on from what @haroon_sa said - you could do something very similar to remove the email from your original column. You could use the regex_replace formula. This will replace the second email with a blank. You just need to make sure you include whatever separates your two email addresses in the pattern. In this case .\s represent any one character (eg a comma) and a space.

 

Regex email.PNG

 

Hope that helps!

kat
12 - Quasar

Two replies at the same time here. Getword is a lot simpler and definitely a better approach :)

msantoso
8 - Asteroid

Hi Haroon, 

 

Great function! 

just a little thing and we'll get there; the punctuation is selected with the first word, so I get Adam@gmail.com, (with the comma at the end)

How can I have it removed? 

 

thanks 

Myriam

vishwa_0308
11 - Bolide

Hi @msantoso,

 

I guess this much simpler regex will solve your issue. It will just keep the first email adress without any punctuation mark at the end. in square bracket i have given comma, semi-colon,dash and a slash. You can also add any wild characters in that square bracket.

 

mailseparation.JPG 

Regards,

Vishwa

msantoso
8 - Asteroid

thanks Vishwa! it works fine!

 

Labels