May-08-2019, 11:50 AM
import re with open('email.txt', 'r') as f: text = f.read() p = re.compile(r'<!--.*-->',re.DOTALL) text = p.sub('', text) p = re.compile(r'^\s*$', re.MULTILINE) text = p.sub('', text) print(text)
Output:Hi
Will do thanks
Boss King
Content Publisher
T. 555-666-777/ M. 555-666-777
From: [email protected];
Sent: Monday, January 28, 2019 12:37:13 PM
To: Team
Subject: RE: Let them know
Hi Iron man,
We can confirm the mission had been cancelled on 25/01/2019
Any contacts made there after should be ignored.
You may notify Me they are persisting
Thank you.
Kind Regards/Vriendelike Groete.
Iron Man
Client Care Media Manager
Client Care/Kliente Diens
T: #43;27 21915 7556
|
E: [email protected]
Personal
|
Commercial
|
Specialist
| Agriculture
From: Almene Barends lt;[email protected];
Sent: 28 January 2019 12:04 PM
To: [email protected];
Subject: Mission
Hi team, please can you assist with this service escalation -client been repeatedly emailed us to cancel her policy
I have requested an email address, do we have another one on file as she is overseas
Thanks
THU 9:48 AM
Good day, I have been emailing for three days to try and stop/cancel my policy as I have immigrated and the house has bee sold.
And every other department responds except for the one that actually NEEDS to do it! 90421050084
FRI 2:05 PM
Have a nice day
Hi Claire, thank you for bringing this to our attention.
James Bond
Content Publisher
T. 555-666-777 / M. 555-666-777
The content of this email is confidential and intended for the addressee only. If it was sent to you in error, please notify the sender immediately and delete the email.
image003.jpgimage/[email protected]:37:13truefalseimage004.jpgimage/[email protected]:37:13truefalseimage005.jpgimage/[email protected]:37:13truefalse396972019-01-28T10:45:35Z2019-01-28T10:45:47ZfalsefalsedigitalSMTPOneOffMarguerite
Reply