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 bSize of this file is/b - . $file_size . brbr;
while (list ($line_num, $line) = each ($fcontents)) {
echo $linebr\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: [EMAIL PROTECTED]
From: [EMAIL PROTECTED]
Date: Tue, 21 Aug 2001 10:32:41 -0700
To: [EMAIL PROTECTED]
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: [EMAIL PROTECTED]
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: [EMAIL PROTECTED]
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: [EMAIL PROTECTED]
From: [EMAIL PROTECTED]
Date: Tue, 21 Aug 2001 10:32:50 -0700
To: [EMAIL PROTECTED]
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: [EMAIL PROTECTED]
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: [EMAIL PROTECTED]
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: [EMAIL PROTECTED]
From: [EMAIL PROTECTED]
Date: Tue, 21 Aug 2001 10:32:57 -0700
To: [EMAIL PROTECTED]
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: [EMAIL PROTECTED]
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: [EMAIL PROTECTED]
Zip:: 41017
Button: Send Request
This is the desired result:
Kenwood Sovereign DVD Promo Kentucky Janis Ross 2033 Damson Drive Villa Hills
[EMAIL PROTECTED]
41017
Kenwood Sovereign DVD Promo Colorado Paul Wu 2313 Hampshire Road Fort Collins
[EMAIL PROTECTED]
80526 yes
Kenwood Sovereign DVD Promo CA Alan T. Lim 3494 Yuba Avenue San Jose [EMAIL PROTECTED]
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/
--
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]