I have a label that sorts all my email marketing from one company. I want to export the search results so I can grab the subject lines. There are about 350 messages, and I wanted to research the subject lines. Any ideas?

4 Answers 4


You can use MsgExtract to export only the subject lines or any other email field to excel or to a text file.

After you label the search in gmail, you only need to select the same label in MailExporter and then select the email parts that you want the export:

enter image description here

You can find further information about MsgExtract exporting features here:


(Disclaimer, I am the author of Msgextract)

  • That is EXACTLY what I was looking for @jponce thanks. I will try it out :)
    – gabearnold
    Commented Nov 10, 2012 at 15:44
  • 1
    Mac OS support?
    – Alex Cook
    Commented Jan 16, 2013 at 20:17

This trick only works on one hundred at a time, in the normal view of all your email subject threads. If you check all the boxes, then click More > Forward as Attachment, it will open a new composition window with each email as an attachment. You can select the list of attachments as text at that point and copy it out to somewhere else. Then trash the new email.


One way to do this is to extract messages to text files by using an IMAP mail client and then using a regular expression to extract subject lines from these text files.

I tried this with Thunderbird.

By default, Thunderbird exports messages by creating one text file per message. Thunderbird names files according to this format: "{subject} - {sender} - {date}.eml". So I already had subjects in file names. Then I just used terminal and redirected ls (use dir, if using Windows) output to a separate text file:

ls -1 > mymessages.txt

In Windows you'd do this:

dir /B > mymessages.txt

If you want to get rid of the sender and date part, you can use your favorite regex supporting text editor (like Notepad++ or vi) and find

^(.*) - .* - .*.eml

in mymessages.txt, replacing it with $1 or \1 (depending on your editor)

  • I may try this - but I would have to download 51,000+ message first. I'm not sure if that's a good plan...
    – gabearnold
    Commented Nov 5, 2012 at 18:21

You can apply a label to the emails you want to export.

Then in https://www.google.com/settings/takeout/custom/gmail :

Click 'Select labels' and choose the label you applied. Click 'Create Archive'

  • Seems to want to export a *.mbox file that you need Thunderbird to open? Commented Mar 17, 2021 at 22:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .