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
Solved! Go to Solution.
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.
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
Hi @msantoso
This solution will make sense. Hope this solution is what you exactly need.
If you have any queries let me know.
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.
Hope that helps!
Two replies at the same time here. Getword is a lot simpler and definitely a better approach :)
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
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.
Regards,
Vishwa
thanks Vishwa! it works fine!