title: How to extract Google Takeout MBOX emails into Google Docs?
body: <p>I have a scenario where I need to extract emails by certain senders and threads from a Google Takeout <code>mbox</code> archive into multi-paged Google Docs that preserve rich text / HTML formatting and the entire thread into a single doc.</p>
  
  <p>For example, all emails from "John Smith" of subject "X" must go into a multipage Google Docs document that starts with the first email in the thread and creates a new page for each reply until they are all captured into this document.  Likewise this must again be done for all other subjects from "John Smith".  All of these documents are also placed into a specific folder within a Google Docs folder.</p>
  
  <p>I initially started off with an <a href="https://github.com/meh/ruby-mbox" rel="nofollow">mbox parsing</a> approach wherein I search for all of the messages of said user with a singular subject thread, and then was planning to push those on over <a href="https://github.com/guivinicius/simple_google_drive" rel="nofollow">into a Google Doc</a>, but then got to thinking that perhaps there are some other more efficient ways to process this.</p>
  
  <p>Has anyone had any experience doing something similar before in an efficient way and could you share what worked for you?</p>