I have a whole bunch of emails that I need pull information from. I recently took on a site that stored all their contact information for customers in emails. They want to start storing this in a database. I'm working with Java trying to pull this information out. I'm kind of stuck.
I have been able to load the emails themselves, but have been unable to extract the information. Here's an example email:
> ---------------------------------------------------------------------- > Name: Person's Name > Phone:=20 > Email: [email protected] > Street:=20 > City:=20 > State:=20 > Zip:=20 > Country:=20 > Arrival: 15 Nov 2010 > Departure: 22 Nov 2010 > Message: This is a message > ---------------------------------------------------------------------- > Name: Second Person > Phone:=555-5554 > Email: [email protected] > Street:=1234 Main St. > City:=20 > State:=20 > Zip:=23412 > Country:=20 > Arrival: 15 Nov 2010 > Departure: 22 Nov 2010 > Message: This is a message > ---------------------------------------------------------------------- I need to pull everywhere there is not an =20. I need to somehow get all this information into a table or CSV file so I can import it into a mysql database.
Edit:
This is actually what the file looks more like
> ---------------------------------------------------------------------- > Name: Erin > Phone: 401- > Email: eri > Street: 737 > City: Paw > State: > Zip: 02 > Country: USA > Arrival: 17 Jul 2011 > Departure: 23 Jul 2011 > Message: I .=20 > ---------------------------------------------------------------------- >=20 > A representative will be in touch shortly. > Thank You, > >=20 Begin forwarded message: > From: > Date: July 8, 2010 12:35:13 PM EDT > To: > Subject: Thank you for completing our contact form! >=20 > Thank you for completing our contact form! We received the following = information from you: > ---------------------------------------------------------------------- > Name: Ludd > Phone:=20 > Email: aedu > Street: 25 > City: Signal > State: > Zip: > Country: USA > Arrival: 25 Nov 2010 > Departure: 30 Nov 2010 > Message: Not sure if > ---------------------------------------------------------------------- >=20 > A representative will be in touch shortly. > Thank You, > >=20 Begin forwarded message: > From: > Date: July 8, 2010 11:29:49 AM EDT > To: > Subject: Thank you for completing our contact form! >=20 > Thank you for completing our contact form! We received the following = information from you: > ---------------------------------------------------------------------- > Name: Stephanie > Phone: 41 > Email: sgor > Street: 2- > City: > State: On > Zip: 1J6 > Country: > Arrival: 18 Aug 2010 > Departure: 21 Aug 2010 > Message:=20 > ---------------------------------------------------------------------- >=20 > A representative will be in touch shortly. > Thank You, >=20 Begin forwarded message: > From: > Date: July 8, 2010 11:16:36 AM EDT > To: > Subject: Thank you for completing our contact form! >=20 > Thank you for completing our contact form! We received the following = information from you: > ---------------------------------------------------------------------- > Name: Stacey > Phone: 001 > Email: staceymou > Street: 60 > City: New York > State: NY > Zip: 0 > Country: USA > Arrival: 10 Dec 2010 > Departure: 14 Dec 2010 > Message: Looking to reserve > ----------------------------------------------------------------------