Parsing a text file of multiple emails

44 views
Skip to first unread message

Matthew Brender

unread,
Jan 28, 2015, 8:54:27 PM1/28/15
to mail...@googlegroups.com
Hello all - I'm getting into coding with ruby and want to start with getting some insights from a set of archives. I have a text file imported and passed using: 

mail = Mail.read_from_string(full_file)

My goal is to separate the different threads of this flat file and I'm curious if mail is the right tool or whether some ugly regex is the only option. The format looks like: 


From: user at site.com 
Date: Thu, 22 Jan 2015 17:59:31 -0500
Subject: This is an email subject 

<< Body >> 

The result shows 0 for mail.parts.length and I don't see a way to start that process of parsing. What would this group of folks recommend? 



Thanks so much, 
Matt 
Reply all
Reply to author
Forward
0 new messages