Extracting Portions of information from email body.

Round_Matt

New Member
Hi Everyone,

I've been trying to extract certain parts of an email body that has been stored in a data item, Issue i am coming across is pulling the following into seperate Data items so they can be used later to input data into a form elsewhere.

From the below text i am trying to extract information such as the Name, Email, Post code, Contact Number.

I have tried a couple of different things like using InStr but its giving me an ouput as a number and not giving me the text.

Can anyone advise anything i could use to get around this?

Thanks

Matt

"From: Company Name Contact Form Submitted <noreply@Business-Name.com>
Date: Fri, 25 Jan 2019 at 08:53
Subject: Company Name Contact Form Submitted: Commercial Property Surveys - www.Company Name.com/contact-us/index.html @ 2019/01/25 08:53:03 (GMT)
To: <enquiry@Company Name.com>

Company Name Contact Form Submitted: Commercial Property Surveys - www.Company Name.com/contact-us/index.html@ 2019/01/25 08:53:03 (GMT)
Reason for Contacting:
Commercial Property Surveys
Name:
matthew round
Company Name:
Business
Email:
matthew.round@Business-Name.com
Telephone:
2035359476
Customer Type:
Post Code:
----- Property Address -----
House No/Property Name:
Building
Address Line 1:
Company Way
Town / City:
Dudley
County:
West Midlands
Post Code:
DY1 1DY
Preferred Date:
Preferred Time:
Your enquiry...:
TESTING FOR AUTO INSERT TO NAV PLEASE FORWARD DIRECTLY TO matthew.round@Business-Name.com
I want to receive marketing communications from Company Name:
unticked, NO do not send offers
PPC:
0
GCLID:
Database ID:
11947



Please consider the environment before printing this e-mail.
Company Name Limited is a trading name of
Company Name UK Ltd registered in England No. 123564
Registered Office: Riverbank, Meadows Business Park, Blackwater, Camberley, Surrey, AA11 1AA.
Information in this message is confidential and is
intended solely for the persons to whom it is addressed.
If you are not the intended recipient please notify the
sender and immediately delete this message from your
computer.
This system may be monitored or recorded to
secure the effective operation of the system
and for other lawful purposes.
"
 

sivagelli

Well-Known Member
Reason for Contacting:
Commercial Property Surveys
Name:
matthew round
Company Name:
Business
Email:
matthew.round@Business-Name.com
Telephone:
2035359476
Customer Type:
Post Code:
----- Property Address -----

From the entire email text, I am assuming this quoted piece has all the data you are looking to extract from. If so, you can rely on Extract Regex action from Strings Utility. However, the challenge would be that the boundaries should be same.

For example, to extract name, 'matthew round' from above text, you can use- Name:\n(.*?)\n Business Name. This works every time if name to extract falls between 'Name:\n' and '\n Business Name'.

Hope this helps!
 

Round_Matt

New Member
From the entire email text, I am assuming this quoted piece has all the data you are looking to extract from. If so, you can rely on Extract Regex action from Strings Utility. However, the challenge would be that the boundaries should be same.

For example, to extract name, 'matthew round' from above text, you can use- Name:\n(.*?)\n Business Name. This works every time if name to extract falls between 'Name:\n' and '\n Business Name'.

Hope this helps!



Hi SG,

Ive tried that Syntax and its giving me an error, Apologies im quite new to this and struggling on this one. View attachment 1548679275665.png

Thanks
 

sivagelli

Well-Known Member
You have to use the regex pattern with 'Extract Regex Values' action from String Manipulation VBO.
Follow this post and use the regex pattern I have shared above to extract required values.

Post back how it goes!
 
Top