ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   parse email address (https://www.excelbanter.com/excel-discussion-misc-queries/117367-parse-email-address.html)

Michael Connolly

parse email address
 
Hi,
I need to parse a email address to get the url.

Given a cell containing:


I need to extract:
reallycoolurl.com

Any help is GREATLY appreciated.
Thanks
MJC



Bob Umlas, Excel MVP

parse email address
 
Please don't cross-post.
=mid(a1,find("@",a1)+1,255)

"Michael Connolly" wrote:

Hi,
I need to parse a email address to get the url.

Given a cell containing:


I need to extract:
reallycoolurl.com

Any help is GREATLY appreciated.
Thanks
MJC




Dallman Ross

parse email address
 
In , Michael Connolly
spake thusly:

Given a cell containing:


I need to extract:
reallycoolurl.com


Assuming address in A1:

=MID(A1,FIND("@",A1)+1,100)

(Presumes no domain parts are longer than 100 chars.)

-dman-

Bruce Sinclair

parse email address
 
In article , Dallman Ross <dman@localhost. wrote:
In , Michael Connolly
spake thusly:

Given a cell containing:


I need to extract:
reallycoolurl.com


Assuming address in A1:

=MID(A1,FIND("@",A1)+1,100)

(Presumes no domain parts are longer than 100 chars.)


... wouldn't the 'RIGHT' function do the same thing without the limit ?


Dallman Ross

parse email address
 
In , Bruce Sinclair
spake thusly:

In article , Dallman Ross
<dman@localhost. wrote:


In , Michael Connolly
spake thusly:

Given a cell containing:


I need to extract:
reallycoolurl.com


Assuming address in A1:

=MID(A1,FIND("@",A1)+1,100)

(Presumes no domain parts are longer than 100 chars.)


.. wouldn't the 'RIGHT' function do the same thing without the limit ?


Yes, but then I'd have had to bother with LEN and a subtraction
step, I think. It just seemed easier this way, and unlikely to
cause any problems. For example, looking at the 446 spam messages
in my spam folder (Unix system) this morning and extracting all
(putative) domain names from all email addresses in all headers and
bodies, then sorting by length, here are the longest 20:

1:02pm [~/Mail/spam] 561[0] strnlnsort.sh addies | head -20
walkerect.com$BMM$NBID$B$O$3$A$i$K$J$C$F$*$j$^$9B
ds084-096-074-036.hosting.mediationtelecom.net
USCOBRMFA-SE-51.northamerica.cexp.com
ltrexchbh01.littlerock.aetc.ds.af.mil
kellythurnderkelly.orangehome.co.uk
S0106000d88f5a4af.ca.shawcable.net
internationalfinancialpartners.org
01C7005F.F059AB50/A/span/fontfont
01C701A3.EFC30160/A/span/fontfont
01C7024F.DF7558B0/A/span/fontfont
20132240031.user.veloxzone.com.br
acumen1.calgary.acumencapital.com
mail0.dc-vig.siscom.comunitel.net
mta300.email.americanexpress.com
ninaa.ninaa.copthorneprep.co.uk
proyectosgei.e.telefonica.netbr
SNV-XCHMAIL.xch.corp.yahoo.com
cleanmail-04-02.mailranger.com
cpysmtpmx3.frontalmixto.correo
pl.endress.com..._No_such_user

Not even the bogosity in spammers' made-up addresses gets very
long.

We could set the 100 in my formula above much higher, too.
I didn't bother, because I thought I'd be nice to system memory.
I don't actually know if an upper limit that isn't used is
committed when Excel runs a formula, however. It was just
a guess at being nice to the system at zero expected cost.

Obtw: i see some from this experiment that some junk mail from
American Express inadvertently made it into my spam pile. I
should go fish that out. I don't want it, but it's not actually
spam. :-)

-dman-


All times are GMT +1. The time now is 10:11 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com