Extracting Email Addresses From A Large Text File

M

Miles

Greetings,

Environment: Access 32-bit, DAO 3.x

We have a very large text file loaded with email
addresses that we need to query out into a table. Does
anyone have any code samples already written to get us
started? We just want to pull the email addresses from
each line and nothing else. They all end in ".com"
or ".org", if that helps.

Many thanks in advance!
 
M

Miles

Thanks, but I would rather get an answer via this public
forum in case others want to add additional ideas.
 
C

Cheryl Fischer

Can you provide more information about your text file? Are the email
addresses found one to a row in the file? In a specific position within a
row? Or, does the file have a field delimiter character?
 
S

Sam Hobbs

Miles said:
Greetings,

Environment: Access 32-bit, DAO 3.x

We have a very large text file loaded with email
addresses that we need to query out into a table. Does
anyone have any code samples already written to get us
started? We just want to pull the email addresses from
each line and nothing else. They all end in ".com"
or ".org", if that helps.

Many thanks in advance!

Something that could really help is if the all begin with mailto:. They
probably do not (not all?) but if they do then obviously that would help.

For a quick, inefficient solution, perhaps you can use a "regular
expression". Doesn't VB have those? An email address consists of a
(e-mail address removed) or .org, right? I think you can make a regular expression
to find them.
 
M

Miles

Hi,

They're right next to each other and going across with
commas in between.

example:

HEADER SECTION FIRST THEN...
(e-mail address removed), (e-mail address removed), (e-mail address removed), (e-mail address removed),
etc...from line 1 to line X.

I know LineInput() will help, but need help thinking
about the parsing part [mid(), left(), etc].

Thanks!
 
C

Cheryl Fischer

Yes, I think you are on the right track with reading in your file
line-by-line with the Open Statement. You might want to try parsing the
LineInput string using the Split() function.

hth,

--
Cheryl Fischer
Law/Sys Associates
Houston, TX

Miles said:
Hi,

They're right next to each other and going across with
commas in between.

example:

HEADER SECTION FIRST THEN...
(e-mail address removed), (e-mail address removed), (e-mail address removed), (e-mail address removed),
etc...from line 1 to line X.

I know LineInput() will help, but need help thinking
about the parsing part [mid(), left(), etc].

Thanks!
-----Original Message-----
Can you provide more information about your text file? Are the email
addresses found one to a row in the file? In a specific position within a
row? Or, does the file have a field delimiter character?

--
Cheryl Fischer
Law/Sys Associates
Houston, TX




.
 
Y

Your name

Something like this perhaps?

do while not eof
emailarray = split(lineinput)
for i = 0 to ubound(emailarray)
send email to emailarray(i)
next
loop




[email protected]:


Hi,

They're right next to each other and going across with
commas in between.

example:

HEADER SECTION FIRST THEN...
(e-mail address removed), (e-mail address removed), (e-mail address removed), (e-mail address removed),
etc...from line 1 to line X.

I know LineInput() will help, but need help thinking
about the parsing part [mid(), left(), etc].

Thanks!
-----Original Message-----
Can you provide more information about your text file? Are the email
addresses found one to a row in the file? In a specific position within a
row? Or, does the file have a field delimiter character?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top