Sign in to follow this  
Followers 0
jack87

EXTRACT EMAIL FROM TXT FILES

7 posts in this topic

Hi guys,

i'm new on this forum and on autoit.

I need as soon as possible a program to extract emails, faxes and html websites from .txt files.

i have thousands of these info:(examples)

company 1

adress 1xx

continue adress 1xx

Phone 1xxx

Fax 1xxxx

email 1xxxx

http 1xxxx

company 2

adress 2xx

continue adress 2xx

Phone 2xxx

Fax 2xxxx

email 2xxxx

http 2xxxx

so what strings should i create to extract the files and collect them on a new .txt file?

any help will be very useful thanks!

Share this post


Link to post
Share on other sites



thank you SEuBo, in which line i have to insert the .txt file i want to get the emails from?

Share this post


Link to post
Share on other sites

thank you SEuBo, in which line i have to insert the .txt file i want to get the emails from?

First Line "FileRead(@DesktopDir&"\company.txt")". Just replace that with "FileRead([yourfilepath])"

Share this post


Link to post
Share on other sites

it gives array error on this part

ReDim $aRet[Floor(UBound($email)-1 /2)]

For $i = 0 to UBound($email)-1 Step 2

$aRet[$i/2] = $email[$i]

what can i change?

Share this post


Link to post
Share on other sites

I would suggest that you change your text file to a ini format then you can use the iniread, inireadsection etc. Much easier and more powerful than your other option of fileread.

I also would suggest that you do not understand the purpose of this forum. Most people do not take well to scripting demands with as soon as possible tagged to it. The expectation is that you have at least tried to solve the problem and have code to present instead of "so what strings should i create to extract the files". You will get a much better response if you adhere to this.

Picea892

Share this post


Link to post
Share on other sites

it gives array error on this part

ReDim $aRet[Floor(UBound($email)-1 /2)]

For $i = 0 to UBound($email)-1 Step 2

$aRet[$i/2] = $email[$i]

what can i change?

Try to replace it with:

For $i = 0 to UBound($email)-1 Step 2
    _ArrayAdd($aRet,$email[$i])
Next

(erase the ReDim [...] too)

Now you also need #include <Array.au3>

This should be a bit slower, but that should not fail at all. (Didnt test it.)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0