Export message data to CSV file

User Help for Mozilla Thunderbird
Post Reply
RogerE
Posts: 30
Joined: March 26th, 2005, 6:53 am

Export message data to CSV file

Post by RogerE »

The emails were sent from a database form with the message body in the format:
[code]
Child name : Child Name

Child DoB : 26/10/2014

Child Gender : Male

Parent name : Parent Name

Landline No : 0499 999999

Mobile No : 0799999999

Parent email : parentname@gmail.com

Address 1 : 1 The Street

Village : Areaname

Town : Townname

Postcode : XX160XX

Comments : Any added comments here

Added : 13, November 2019 08:50 PM

Data was not saved to database
[/code]

We want to be able to extract the email body data to a CSV file so it can be imported into a database.

I have tried using ImportExport Tools NG but it only seems to export header details:
Subject
From
To
Date/Time
and then every entry has a single word "Subject"

I assume I am doing something incorrectly - or is there another way to export the message (not worried about header details)

Thanks

Roger
User avatar
LIMPET235
Moderator
Posts: 39952
Joined: October 19th, 2007, 1:53 am
Location: The South Coast of N.S.W. Oz.

Re: Export message data to CSV file

Post by LIMPET235 »

Moving this to Thunderbird Support...
[Ancient Amateur Astronomer.]
Win-10-H/64 bit/500G SSD/16 Gig Ram/450Watt PSU/350WattUPS/Firefox-115.0.2/T-bird-115.3.2./SnagIt-v10.0.1/MWP-7.12.125.

(Always choose the "Custom" Install.)
User avatar
DanRaisch
Moderator
Posts: 127222
Joined: September 23rd, 2004, 8:57 pm
Location: Somewhere on the right coast

Re: Export message data to CSV file

Post by DanRaisch »

Which option in the ImportExportTools NG menu did you choose for that export? There are two relating to CSV output. If you chose the one at the bottom ("Export all messages in a folder->Just index (CSV)") it did what it was supposed to. The option you want may be Tools->ImportExportTools NG->Export all messages in the folder->Spreadsheet (CSV)".
morat
Posts: 6421
Joined: February 3rd, 2009, 6:29 pm

Re: Export message data to CSV file

Post by morat »

Ask whoever to export the data to csv or txt files, then send those files using a zip file.

P.S.

An idea...

Tools > ImportExportTools NG > Export all messages in the folder > Plain text format

Command Prompt:

Code: Select all

for %a in ("*.txt") do ( grep -v "^Subject:\|^From:\|^Date:\|^To:\|^$" "%a" > "%~na_fixed.txt" )
Open the *_fixed.txt files in LibreOffice Calc using the ":" separator with the trim spaces option.

Grep for Windows
http://gnuwin32.sourceforge.net/packages.html
http://gnuwin32.sourceforge.net/packages/grep.htm
http://www.gnu.org/software/grep/manual/grep.html
Last edited by morat on February 13th, 2020, 6:48 am, edited 3 times in total.
RogerE
Posts: 30
Joined: March 26th, 2005, 6:53 am

Re: Export message data to CSV file

Post by RogerE »

[quote="DanRaisch"]Which option in the ImportExportTools NG menu did you choose for that export? There are two relating to CSV output. If you chose the one at the bottom ("Export all messages in a folder->Just index (CSV)") it did what it was supposed to. The option you want may be Tools->ImportExportTools NG->Export all messages in the folder->Spreadsheet (CSV)".[/quote]


It is the "Export all messages in the folder->Spreadsheet (CSV)" that I assumed would work, and produces the result I indicated.
Post Reply