From maildir\brawner-s\inbox
1 17
In [20]:
import re
In [21]:
with open("17", "r") as f:
b = f.read()
b = b.replace("\t", "")
b = b.replace("\n", "")
Show how I got this
Also, why using search(). Only match one.
In [37]:
d1 = re.search("To: ([\w@,. \-\'\<\>]*)Subject", b).group(1)
In [23]:
with open("1", "r") as f:
c = f.read()
c = c.replace("\t", "")
c = c.replace("\n", "")
In [24]:
d2= re.search("To: ([\w@,. \-\'\<\>]*)Subject", c).group(1)
In [25]:
print re.search("From: ([\w@,. \-\'\<\>]*)To", c).group(1)
print re.search("From: ([\w@,. \-\'\<\>]*)To", b).group(1)
In [38]:
len(d1)
Out[38]:
In [39]:
d1 = d1.split(",")
In [40]:
d1 = [d.replace(" ","") for d in d1]
d1[:6]
Out[40]:
In [ ]: