O
O
Otrivin2018-02-20 11:15:50
Email
Otrivin, 2018-02-20 11:15:50

How to extract data from eml or mbox emails?

Hello!
I have a large number of letters in eml-format, standardized content. From letters it is required to take out an e-mail, phone number and name, and then put this data into an excel / text file. How can this be done, except for manual copying from each letter?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
Otrivin, 2018-02-20
@Otrivin

Used a crutch on regular expressions and Notepad ++

Letter Format:
Return-Path: <...>

%Всякие заголовки письма%

Date: Tue, 7 Nov 2017 02:47:02 +0300

%Опять заголовки...%

 Message-ID: ...
X-Spam-Action: no action
X-Original-To: [email protected]

Name: Имя<br>
Email address: [email protected]<br>
Message: 88005553535<br>

1) Put the letters in eml into a folder, go through "Text Replacement" with regular expressions:
"([\s\S]*)Date:" В "	Date:" ;
"\+0300([\s\S]*)Name:" В "+0300	Name:" ;
"<br>
Email" В "	Email" ;
"<br>
Message" В "	Message" ;
"<br>" В "" ;

We replace line breaks with Tabs for correct insertion into Excel
2) Leave the last line break.
3) Then on the command line "copy *.eml all.txt".
4) Copy-paste to Excel
5) ?????
6) PROFIT

S
somitsvk, 2021-04-26
@somitsvk

You can try two simple methods: First, try the manual method and use Mozilla Thunderbird to import mailbox then export data in HTML, RTF & MHTML format using Import-Export tool. Second, use software based on email format: like for EML use MailsDaddy EML to PST Converter that exports emails from EML to PST, EMLX, MSG, HTML, MHTML & RTF format.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question