Okay I have stripped all header and bogus crap out of this file.
Now I am left with formatting and breaking the data up.
How can I do that?
Here is the script that gets me a clean file and print out.
These a piece thats missing up that is a command line script that parses the file for
this
information.
<?
$fcontents = file("/tmp/mail_file.tmp", "r");
$file_size = filesize ("/tmp/mail_file.tmp");
echo "<b>Size of this file is</b> - " . $file_size . "<br><br>";
while (list ($line_num, $line) = each ($fcontents)) {
//name, address, city, state, zip, email, optin end of line
//can you remove the field name
echo "$line<br>";
}
clearstatcache (void)
?>
Here is my output:
State:: CA
Name:: Alan T. Lim
Address:: 3494 Yuba Avenue
City:: San Jose
e-mail: [EMAIL PROTECTED]
Zip:: 95117
State:: Colorado
Name:: Paul Wu
Address:: 2313 Hampshire Road
City:: Fort Collins
e-mail: [EMAIL PROTECTED]
Zip:: 80526
State:: Kentucky
Name:: Janis Ross
Address:: 2033 Damson Drive
City:: Villa Hills
e-mail: [EMAIL PROTECTED]
Zip:: 41017
Here is the desired result, this also involves reordering information:
Alan T. Lim 3494 Yuba Avenue San Jose CA 95117 [EMAIL PROTECTED] yes
Paul Wu 2313 Hampshire Road Fort Collins Colorado 80526 [EMAIL PROTECTED] yes
Janis Ross 2033 Damson Drive Villa Hills Kentucky 41017 [EMAIL PROTECTED] yes
any help would be 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 General 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]