You first file just requires loading into an array and you can use
unique array functions to remove
duplicates etc..

The other files simply load into an array and use preg to strip out what
you want and follow the same
checking and removal of duplicates.

Checkout: preg_match and array functions in the www.php.net manual.



Timothy Hitchens (HiTCHO)
Open Source Consulting
e-mail: [EMAIL PROTECTED]

> -----Original Message-----
> From: Didier McGillis [mailto:[EMAIL PROTECTED]] 
> Sent: Wednesday, 22 January 2003 11:22 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] HELP please quickly
> 
> 
> Here is a brief description of what I want to do.  I want to 
> use PHP to grab 
> a list of numbers in one file.  Check it against a bigger 
> file and strip the 
> ones that match out of the bigger file, into a "holding" file.
> 
> 
> so here is what it might look like.
> 
> file1.txt
> 456789
> 456790
> 456791
> 456792
> 456793
> 456794
> .....
> 
> file2.log
> some time stamp code=001;number=456784;name=blahblah;date=012403;
> some time stamp code=001;number=456785;name=blahblah;date=012403;
> some time stamp code=001;number=456786;name=blahblah;date=012303;
> some time stamp code=001;number=456789;name=blahblah;date=012503;
> some time stamp code=001;number=456789;name=blahblah;date=012503;
> some time stamp code=001;number=456789;name=blahblah;date=012503;
> some time stamp code=001;number=456789;name=blahblah;date=012503;
> some time stamp code=001;number=456789;name=blahblah;date=012503;
> some time stamp code=001;number=456790;name=blahblah;date=012603;
> some time stamp code=001;number=456791;name=blahblah;date=012703;
> 
> notice there might be more then one of the same number, I 
> only need one so I 
> need to ignore the rest, rip out the time stamp, which is a 
> seperate line.
> 
> file3.txt
> code=001;number=456789;name=blahblah;date=012503;
> code=001;number=456790;name=blahblah;date=012603;
> code=001;number=456791;name=blahblah;date=012703;
> 
> can anyone help, any suggestions?
> 
> 
> 
> 
> 
> _________________________________________________________________
> MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.  
> http://join.msn.com/?page=features/virus
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to