Jump to content
Sign in to follow this  
Prakhar

Retrieving Email Addresses from text file

Recommended Posts

Prakhar

Hi everyone , i want an algorithm which can fetch email addresses from normal text file. Eg. A@an.com from text file t.txt which contains - hi brother A@an.com is my email address is THANKS IN ADVANCE


[size="5"]"No Pain, No Gain"[/size]

Share this post


Link to post
Share on other sites
funkey

#Include <Array.au3>

$text = 'hi brother [email="A@an.com"]A@an.com[/email] is my email address'
$Pattern = "[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}"

$a = StringRegExp($text, $pattern, 3)

_ArrayDisplay($a)


Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the Universe
trying to produce bigger and better idiots.
So far, the Universe is winning.

Share this post


Link to post
Share on other sites
Prakhar

Sorry, it didn't worked ,but thanks. I want to fetch all the addresses in the file attached, the file will contain some texts (Like an example of iTunes I've shown in file), the text will not be static it will change now and then.The algorithm should find email address by following expressions :-

@

@@

(@)

<@>

.@.

.at.

(at)

_at_

@at@

\'at\'

\"at\"

(atsign)

(at_sign)

(at-sign)

(at sign)


[size="5"]"No Pain, No Gain"[/size]

Share this post


Link to post
Share on other sites
BrettF
Prakhar

Sample of file- Kindltientlinkinemd.gjg.jmdmjtag.mgjmdgmtkgjt.jgkgjgjagjgjhjgjt Mike -mike@gmail.co.in

Tom :Tommy<atsign>domain.com

WeaponX| W.X(@)gmail.com

Gates\gates.at.home.com

Tommy # tom.cool'at'hotmail

jg.wmgj.jagmp.ja.mwgtpgmgjt gmpw.jmwjm.jt.gmtmtdmjgmjtjtmt g.jtpg.mtjmtjgmdj.tgdmjtgmgt.mdjtg


[size="5"]"No Pain, No Gain"[/size]

Share this post


Link to post
Share on other sites
PsaltyDS

WeaponX| W.X(@)gmail.com

People obfuscate their email addresses like that for a reason... and where exactly did the file come from?

:D


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
Valik

We will not help you in your endeavor. Thread locked, do not ask again.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×