Help help help ... or something like that
| From: | Dan McCullough | Date: | Fri, 24 Aug 2001 17:20:24 +0000 |
| Subject: | Help help help ... or something like that | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-64265@lists.php.net to get a copy of this message | ||
I have a burning question that needs to be looked at, and see if someone can give me an idea of a
way to get the desired result. Are you ready.
Here is my problem, I need to strip out of an mbox file everything but the body of the email, now
to complicate matters this is an extremly large file, now seeing as it is a mbox file, and there
for has a set pattern of information display, I figure there must be some way of striping the
header information.
Here is my code, which displayes the file, very easy and gives me the file size.
<?
$fcontents = file("/home/sites/projects/web/extractor/Main.mbx", "r");
$file_size = filesize ("/home/sites/projects/web/extractor/Main.mbx");
echo "<b>Size of this file is</b> - " . $file_size .
"<br><br>";
while (list ($line_num, $line) = each ($fcontents)) {
echo "$line<br>\n";
}
clearstatcache (void)
?>
Here is the output resulting from the above code, I have only copied 3 listings.
Size of this file is - 2915641
From Tue Aug 21 10:32:42 2001
Received: from killer2.nextmill.net [216.115.243.3] by thedigitallab.com with ESMTP
(SMTPD32-6.05) id AB392F8015A; Tue, 21 Aug 2001 10:32:41 -0700
Subject: Kenwood Sovereign DVD Promo
Sender: "alanlim@mail.com"
From: "alanlim@mail.com"
Date: Tue, 21 Aug 2001 10:32:41 -0700
To: "kenwood@thedigitallab.com"
X-Priority: 1
X-MSMail-Priority: High
Content-Transfer-Encoding: Quoted-Printable
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
X-Mailer: JMail 3.7.0 by Dimac (www.dimac.net)
Message-Id: <200108211032115.SM01248@killer2.nextmill.net>
X-RCPT-TO:
X-UIDL: 298071585
Status: U
Contact Us
Subject: Kenwood Sovereign DVD Promo
State:: CA
Name:: Alan T. Lim
Address:: 3494 Yuba Avenue
City:: San Jose
e-mail: alanlim@mail.com
Zip:: 95117
opt-in: yes
Button: Send Request
From Tue Aug 21 10:32:50 2001
Received: from killer2.nextmill.net [216.115.243.3] by thedigitallab.com with ESMTP
(SMTPD32-6.05) id AB414EB01A6; Tue, 21 Aug 2001 10:32:49 -0700
Subject: Kenwood Sovereign DVD Promo
Sender: "pwu888@hotmail.com"
From: "pwu888@hotmail.com"
Date: Tue, 21 Aug 2001 10:32:50 -0700
To: "kenwood@thedigitallab.com"
X-Priority: 1
X-MSMail-Priority: High
Content-Transfer-Encoding: Quoted-Printable
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
X-Mailer: JMail 3.7.0 by Dimac (www.dimac.net)
Message-Id: <20010821103226.SM01248@killer2.nextmill.net>
X-RCPT-TO:
X-UIDL: 298071586
Status: U
Contact Us
Subject: Kenwood Sovereign DVD Promo
State:: Colorado
Name:: Paul Wu
Address:: 2313 Hampshire Road
City:: Fort Collins
e-mail: pwu888@hotmail.com
Zip:: 80526
opt-in: yes
Button: Send Request
From Tue Aug 21 10:32:58 2001
Received: from killer2.nextmill.net [216.115.243.3] by thedigitallab.com with ESMTP
(SMTPD32-6.05) id AB494ED01A6; Tue, 21 Aug 2001 10:32:57 -0700
Subject: Kenwood Sovereign DVD Promo
Sender: "mjastuart@yahoo.com"
From: "mjastuart@yahoo.com"
Date: Tue, 21 Aug 2001 10:32:57 -0700
To: "kenwood@thedigitallab.com"
X-Priority: 1
X-MSMail-Priority: High
Content-Transfer-Encoding: Quoted-Printable
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
X-Mailer: JMail 3.7.0 by Dimac (www.dimac.net)
Message-Id: <200108211032737.SM01248@killer2.nextmill.net>
X-RCPT-TO:
X-UIDL: 298071587
Status: U
Contact Us
Subject: Kenwood Sovereign DVD Promo
State:: Kentucky
Name:: Janis Ross
Address:: 2033 Damson Drive
City:: Villa Hills
e-mail: mjastuart@yahoo.com
Zip:: 41017
Button: Send Request
This is the desired result:
Kenwood Sovereign DVD Promo Kentucky Janis Ross 2033 Damson Drive Villa Hills mjastuart@yahoo.com
41017
Kenwood Sovereign DVD Promo Colorado Paul Wu 2313 Hampshire Road Fort Collins pwu888@hotmail.com
80526 yes
Kenwood Sovereign DVD Promo CA Alan T. Lim 3494 Yuba Avenue San Jose alanlim@mail.com 95117 yes
Please any help would be greatly appreciated ...
thanks
dan
=====
Dan McCullough
-------------------------------------------------------------------
"Theres no such thing as a problem unless the servers are on fire!"
h: 603.444.9808
w: McCullough Family
w: At Work
__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/