Question: Need help with writing python code (v 2.7.x) to traverse through a folder structure, read all the text files (emails) and extract From and To
Need help with writing python code (v 2.7.x) to traverse through a folder structure, read all the text files (emails) and extract From and To email addresses and write the output to a CSV file.
email format 
Folder structure
| Mailbox | Name1 | text 1 |
| text 2 | ||
| Name 2 | text 3 | |
| text 4 | ||
| text 5 |
Message-ID: Date: Fri, 7 Dec 2001 10:06:42 -0800 (PST) From: heather.dunton@enron.com To: k..allen@enron.com Subject: RE: West Position Mime-Version 1.0 Content-Type: text/plain; charset-us-ascii Content-Transfer-Encoding: 7bit X-From: Dunton, Heather /OU-NA/CN-RECIPIENTS/CN-HDUNTO X-To: Allen, Phillip K. ENRON/OU-NA/CN-RECIPIENTS/CN-Pallern X-CC: X-bcc: X-Folder: \Phillip_Allen_Jan2002_1\Allen, Phillip K. \Inbox X-Origin: Allen-P X-FileName: pallen (Non-Privileged) .pst Please let me know if you still need Curve Shift. Thanks, Heather
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
