Another question

From: Date: Fri, 24 Aug 2001 20:30:14 +0000
Subject: Another question
Groups: php.general 
Request: Send a blank email to php-general+get-64331@lists.php.net to get a copy of this message
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: alanlim@mail.com Zip:: 95117 State:: Colorado Name:: Paul Wu Address:: 2313 Hampshire Road City:: Fort Collins e-mail: pwu888@hotmail.com Zip:: 80526 State:: Kentucky Name:: Janis Ross Address:: 2033 Damson Drive City:: Villa Hills e-mail: mjastuart@yahoo.com Zip:: 41017 Here is the desired result, this also involves reordering information: Alan T. Lim 3494 Yuba Avenue San Jose CA 95117 alanlim@mail.com yes Paul Wu 2313 Hampshire Road Fort Collins Colorado 80526 pwu888@hotmail.com yes Janis Ross 2033 Damson Drive Villa Hills Kentucky 41017 mjastuart@yahoo.com 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/

« previous php.general (#64331) next »