Posted by "Albert" on 01/13/06 16:37
> I have large log files from a web server (about a gig in size) and need
> to parse each line looking for a string, and when encountered push that
> line to a new file. I was thinking I could have PHP read in the whole
> file, but thinking it could be a major pain since I have about 20 log
> files to read through.
> Anyone have some suggestions?
Is this on a Linux server?
Why don’t you use grep?
cat <filename> | grep <string> > <newfile>
see man grep for detail on grep. (It uses regular expressions)
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.14.17/228 - Release Date: 2006/01/12
[Reply to this message]
Copyright © 2005-2006 Powered by Custom PHP Programming