I need to parse the email file in elmx (Mac OS X email file format) to extract some information using regular expression with Python
The email contains the following format, and there are a lot of text before and after.
...
Name and Address (multi line)
Delivery estimate: SOMEDATE
BOOKNAME
AUTHOR and PRICE
SELLER
...
The example is as follows.
...
Engineer1
31500 N. Mopac Circle.
Company, Building A, 3K.A01
Dallas, TX 78759
United States
Delivery estimate: February 3, 2011
1 "Writing Compilers and Interpreters"
Ronald Mak; Paperback; $21.80
Sold by: Textbooksrus LLC
...
How can I parse the email to extract them? I normally use line = file.readline(); for line in lines, but in this case some of the info is multi-line (the address for example).
The thing is that those information is just one part of big file, so I need to find a way to detect them.