Extract specific data from a folder of .eml files?

tpir72

New Member
Joined
Sep 25, 2011
Messages
43
Hi,
I have a folder of .eml files. They are an exported backup of my gmail account. Each .eml file is a separate email. They can be easily viewed with notepad.
I need to extract these four items. The format is always consistent mixed with other header and body info not needed.

Date:
Member logged in:
Email:
IP:

Date: Sat, 25 Feb 2012 19:25:24 -0700
Member logged in: somemember123
Email: name@gmail.com
IP: 83.121.245.221

Is there a way to scan this folder, have each email (one per row), with column data:

A1=Date:
A2=Member logged in:
A3=Email:
A4=IP:

Some emails may only have the Date: information. Is there a way to automate the process to scan the folder, only extract info if all four bits of information are available, add this data to one email message per row and ignore all other emails without all four bits of data present?

This is way over my head. I know some of you can come up with a formula in your sleep to do this.

I have thousands of emails to extract this data from.

Any help is sincerely appreciated.

Regards,

Terry
 
Hi Dominic,
Sorry for the delay in confirming this. It works great!

Thank you very much.

Regards,

Terry
 
Upvote 0

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Hi - I have a similar problem with a list of teachers' details that I have backed-up as Outlook .EML files. I am trying to transfer these individual files across to Excel so that I am able to sort data by column, etc.. Appreciate your help if that is possible as I am not too familiar with writing code, etc. I have about 1,000 EML files each representing a teacher's info, so I'm kinda freaking out to think that I might have to re-type everything on Excel manually! Any help you can offer will be MOST appreciated. Here is a sample of what I'm trying to transfer across to Excel, with each field on a different column (info is changed to keep confidentiality). Outcome I am hoping is A1=Name, A2=Email Address:, A3=NRIC number, etc. Thanks! Name: Annie L.

Email Address: Anlee@hotmail3.com

NRIC number 124567

Age 50

Gender Female

Nationality US

Race Caucasian

Full address 617 Bedford Road #03-1234

Postal code 560618

HandPhone number 12345678

Home number

Highest qualification achieved Msc and Bachelors

Years of experience more than 20 years

Commitment Full-time teacher

Institutions attended (Sec/JC/Poly/Uni) ABC college
Your grades for those subjects you are teaching in General Paper
Maths C

Current occupation Teacher

Preferred locations East

Level/subject to teach (Pri 1-Pri 3) Science

Pri English
 
Upvote 0
Hi Domenic
I've been trying to backward engineer your macro to do a similar task on a load of 'Sent' emls but failing miserably
The 2 fields I require (to re create a lost address book) from the following sent headers are 'To: "My Friend"<myfriend@gmail.com>'
Could you kindly give me a clue?

Example header:

From: "Me Myself" <me@myself.com>
To: "My Friend" <myfriend@gmail.com>
References: <CAMub0XGZp8wvnFDud2UESmT6Rcd_Hu114YkJaovzX4azLuTY9A@mail.gmail.com>
In-Reply-To: <CAMub0XGZp8wvnFDud2UESmT6Rcd_Hu114YkJaovzX4azLuTY9A@mail.gmail.com>
Subject: Re: Thank you for the welcome.
Date: Tue, 17 Sep 2013 17:26:21 +0100
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_034E_01CEB3CB.06E58080"
X-Priority: 3
X-MSMail-Priority: Normal
Importance: Normal
X-Mailer: Microsoft Windows Live Mail 14.0.8089.726
X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726

This is a multi-part message in MIME format.

------=_NextPart_000_034E_01CEB3CB.06E58080
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi My Friend,

bla bla bla =


Regards
Kieran
 
Upvote 0
Hi Domenic
I've been trying to backward engineer your macro to do a similar task on a load of 'Sent' emls but failing miserably
The 2 fields I require (to re create a lost address book) from the following sent headers are 'To: "My Friend"<myfriend@gmail.com>'
Could you kindly give me a clue?

Example header:

From: "Me Myself" <me@myself.com>
To: "My Friend" <myfriend@gmail.com>
References: <CAMub0XGZp8wvnFDud2UESmT6Rcd_Hu114YkJaovzX4azLuTY9A@mail.gmail.com>
In-Reply-To: <CAMub0XGZp8wvnFDud2UESmT6Rcd_Hu114YkJaovzX4azLuTY9A@mail.gmail.com>
Subject: Re: Thank you for the welcome.
Date: Tue, 17 Sep 2013 17:26:21 +0100
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_034E_01CEB3CB.06E58080"
X-Priority: 3
X-MSMail-Priority: Normal
Importance: Normal
X-Mailer: Microsoft Windows Live Mail 14.0.8089.726
X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726

This is a multi-part message in MIME format.

------=_NextPart_000_034E_01CEB3CB.06E58080
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi My Friend,

bla bla bla =


Regards
Kieran
 
Upvote 0
How do I extract text lines of interest that start UNDER the criteria? For example like this:

Name:Eric Willoby
Title:
Owner
Company Name:
Premier Contracting
Email:
Panama3@gmx.com

I'm stuck trying to adapt the code.
 
Upvote 0

Forum statistics

Threads
1,223,912
Messages
6,175,348
Members
452,638
Latest member
Oluwabukunmi

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top