ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Improrting Text file to a matrix when things are not constant. (https://www.excelbanter.com/excel-worksheet-functions/47486-improrting-text-file-matrix-when-things-not-constant.html)

underdrain

Improrting Text file to a matrix when things are not constant.
 
I have exported a 200 or so emails from Netscape into a text file. The
body of the emails are relatively short typically under 200 characters.
Netscape has exported ALL of the emails into one TEXT file with the
format shown below. I would like to read this file into Excel to
create a matrix of each email having its own row and the components of
each email having their own column.

--------------------------------------------------------
Subject: (no subject)
Date: Sat, 19 Mar 2005 12:28:33 -0800
From: FirstName LastName
To: Recipent Name

This is the body for the above email header. The length of this body
varies. Before the email body, there is one space. After the body of
the email there is one space and then the next email header starts,
this pattern continues. The "Subject:" line is always present and
either contains "(no subject)" or it is blank as in the next email
header.

Subject:
Date: Sat, 19 Mar 2005 12:28:33 -0800
From: FirstName LastName
To: Recipent Name

This is the next email-body. As suspected, each email has a different
amount of text in the email body. Again, there is one space after this
body before the next header.

Subject: (no subject)
Date: Sun, 20 Mar 2005 12:53:33 -0800
From: FirstName LastName
To: Recipent Name
---------------------------------------------------------------

I would like to read this file into Excel with the following format for
the matrix:

Subject......Date......From.......To.........Email Body
email 1
email 2
email 3
..
..
..



Is this possible? I don't have an exact count on the number of emails
in the large text file.

Thanks for any help.



All times are GMT +1. The time now is 01:11 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com