On Fri, Jan 13, 2006 at 04:47:11PM -0600, Jay Paulson wrote:
> > On Fri, January 13, 2006 3:33 pm, Jay Paulson wrote:
> >> $buf = "";
> >
> > Probably better to initialize it to an empty array();...
>
> Yep right.
>
> >> while (!feof($fhandle)) {
> >> $buf[] = fgets($fhandle);
> >
> > ...
On Fri, Jan 13, 2006 at 04:21:10PM -0600, Richard Lynch wrote:
>
> If you DO use grep, don't cat the whole file out to grep it...
>
> grep __filename__ > __newfile__
oops, forgot the expression :)
grep findthis __filename__ > __newfile__
--
cat .signature: No such file or directory
--
P
On Fri, January 13, 2006 4:47 pm, Jay Paulson wrote:
>> Buffering 10 lines of text in PHP is probably not going to make a
>> significant difference...
>
> This is true. It's what I have written to start with. Basically I'm
> just
> trying to make sure that I'm not hogging system memory with a hug
> On Fri, January 13, 2006 3:33 pm, Jay Paulson wrote:
>> $buf = "";
>
> Probably better to initialize it to an empty array();...
Yep right.
>> while (!feof($fhandle)) {
>> $buf[] = fgets($fhandle);
>
> ... since you are going to initialize it to an array here anyway.
>
>> if ($i++ %
On Fri, January 13, 2006 3:33 pm, Jay Paulson wrote:
> $buf = "";
Probably better to initialize it to an empty array();...
> while (!feof($fhandle)) {
> $buf[] = fgets($fhandle);
... since you are going to initialize it to an array here anyway.
> if ($i++ % 10 == 0) {
Buffering 10 line
On Fri, January 13, 2006 8:37 am, Albert wrote:
> Wolf wrote:
>> 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
>> f
> 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
> file
best way I think is
nohup grep -i string log1 log2 log3 ...logx > newfile &
This will run this command in background and you can work on other
meanwhile.
Thanks
Richard
On 1/13/06, Wolf <[EMAIL PROTECTED]> wrote:
>
> I have large log files from a web server (about a gig in size) and need
> to
Wolf wrote:
Windows server, though I may dump it to linux to get my smaller file,
however not sure my admin would like that. :)
Get a Windows build of grep (and other useful stuff) here:
http://unxutils.sourceforge.net/
Albert wrote:
cat | grep >
Why cat? Sorry, but this is o
Windows server, though I may dump it to linux to get my smaller file,
however not sure my admin would like that. :)
Albert wrote:
> Wolf wrote:
>
>>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
>>
Wolf wrote:
> 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 2
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
12 matches
Mail list logo