This site will have limited functionality while we undergo maintenance to improve your experience. If an article doesn't solve your issue and you want to ask a question, we have our support community waiting to help you at @FirefoxSupport on Twitter and/r/firefox on Reddit.

Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Rohkem teavet

Is it possible to export just the message body, without header info?

  • 8 vastust
  • 1 on selline probleem
  • 16 views
  • Viimati vastas Matt

more options

I need to extract comma delimited data from the message body of multiple email messages for import into a spreadsheet file.

Can I merge the messages, then extract just the body by parsing?

I need to extract comma delimited data from the message body of multiple email messages for import into a spreadsheet file. Can I merge the messages, then extract just the body by parsing?

All Replies (8)

more options

Export your messages as text files. Open those in your text editor, one at a time, select and copy the required text part and paste into a new CSV document. I'd recommend Notepad++ over Notepad. The tabbed interface makes working with multiple files much easier.

IIRC, the ImportExportTools add-on may be able to help you export selected messages directly to a CSV file. I tried it once, but it made a real dog's dinner of it, pushing all the message text into a single field. I doubt it will help with parsing your tabulated data.

I've had people send me documents as email messages. They are generally hard to edit, and harder to convert back to the required format. The html used in email isn't good at respecting layout. I found, and I think you might find, that having the data sent to you as attached CSV or XLSX files is probably more productive.

Muudetud Zenos poolt

more options

Deleted accidental re-posting.

Muudetud Zenos poolt

more options

Thanks for the suggestion. I should have given you better input.

The text of these messages is in the form of comma delimited text which will be imported to a db file that is used as club membership for mailings, dues management, and event registrations etc. It is gathered from an online html page we use for registration and is sent to multiple email addresses as text email. I use my incoming messages to build the db. Other club members use the messages for other purposes.

They come to me sporadically. In some cases it is just a single email which I can copy and past. At other times they come to me by the dozens. Those, I need to merge into a single file which I can parse and import.

Thanks

more options

This is not something Thunderbird can do. However, your operating system can. If we use some tools that have been getting dusty for a couple of decades.

I assume the new and glorious Windows 10 has a command prompt.


Save your email to a folder on the hard disk. (Hold Ctrl and click on the emails to save) The right click context menu works well for this.

copy and paste the following into notepad

@ echo off
copy *.eml collected.dat
del *.eml
notepad collected.dat

remove the leading space on each line Save the notepad file as merge.bat into the same folder you saved your group of emails

Make sure to set it to all files before entering merge.bat or you will not get a bat file but a text file names merge.bat.txt.

Double click on the merge.bat file

Notepad will open with all the emails in a single document. You will still have to manually remove the headers. But it will be better than doing it one file at a time.

Now some caveats... the batch file deletes the mail you saved, but not the merged file. If you do it a second time the merged file will be appended, not replaced. so you will need to do that bit of cleanup yourself.

It may be possible to do what you want with the FiltaQuilla add-on using a javascript action. But that is beyond my simple abilities.

more options

Thanks. I've found a work-around for the time being. Thunderbird offers an option of saving selected messages as 'Spreadsheet (CSV)'. That at least gets them merged into one file.

The next step is to just work through them deleting the header information as a block. Now through the use of find and replace in Notebook++ (enables the use of find and replace for CRLF) I begin rearranging the two field/multi-line format into multiple field/single line format that can be imported in to spreadsheet or db forms.

It's cumbersome but workable.

Thanks for the suggestions

more options

what I suggested will not have line wrapping. but if your happy go your own way in peace.

more options

Matt said

what I suggested will not have line wrapping. but if your happy go your own way in peace.

I tried your method and it works. I discovered that saving the messages from within Thunderbird merges the selected emails into one file without the html hieroglyphics (header information) that Notepad creates. Cleanup is much easier as the unwanted blocks are much smaller and in a more fixed format.

Each record comes to me as: field1,data1CRLF field2,data2CRLF field13,data13CRLF

I don't have control over that format.

I just mark the first field with *field1, replace all the CRLF with comma, replace the *field1 with CR LFfield1. That collects all the data into a single line record. field1,data1,field2,data2,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,field13,data13CRLF

Muudetud grubbyjeans poolt

more options

I think we might be able to do this a better way, but Thunderbird is not going to help. But this interests me.

So take this off forum and email me at unicorn dot consulting at gmail dot com as it is moving away from Thunderbird support and into the realm of data manipulation.

What are you using as your membership DB? What spreadsheet program do you have? Can you supply me a sample of your data say an email to test with?