Parsing an email to find a mailing address?

T

Terry Olsen

I have a very interesting request. A customer receives orders via email.
The email contains the shipping address, shipping method, email address
and phone number. This information is not all together, nor is it in the
same format in each email as the emails come from different order
houses.

The customer wants me to scan the email and pull the information out so
that it can be used to import into their shipping software.

I've been able to copy the body of the email to the windows clipboard
and then into a string variable in VB. But now the hard part, finding
the shipping address.

Has anyone done something like this? How do I recognize a shipping
address in a page full of text?

Some of the different variations on the address are:

Name: Name
Address: 123 Nowhere St
City/State/Zip: Glendale, CA 90000

or

Name
123 Nowhere St
Glendale, CA 90000

or

Name
123 Nowhere St
Glendale, California
90000 USA

or

Name: Name
Address: 123 Nowhere St
City: Glendale
State: ca
Country: usa
Zip: 90000
 
G

Guest

Has anyone done something like this? How do I recognize a shipping
address in a page full of text?

Is the e-mail address passed through the e-mail header? Can you extract it
there?

If not, you can use regular expressions to parse the email address.
 

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