On Sat, 2008-04-05 at 16:19 -0700, Jim Lucas wrote:
> Robert Cummings wrote:
> >>
> >> - Taking away the unnecessary fseek() made the script execute in 63 seconds
> >> - Using a buffer system, (reading in 1Mb of the text file at a time and
> >> then
> >> looping through the string in memory) made
Robert Cummings wrote:
On Sat, 2008-04-05 at 19:09 +0100, Steve McGill wrote:
"Richard Heyes" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Thanks for the heads up on fgetc() incrementing by one. I hadn't actually
tested that code yet, I was using the original fseek($handle,$pos).
So the only variation on a theme that I didn't test is the one that performs
the best by an order of magnitude... nice. Many thanks for your time
everyone.
"Robert Cummings" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> On Sat, 2008-04-05 at 19:09 +0100, Steve McGill wrote:
>>
On Sat, 2008-04-05 at 19:09 +0100, Steve McGill wrote:
> "Richard Heyes" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> >> Thanks for the heads up on fgetc() incrementing by one. I hadn't actually
> >> tested that code yet, I was using the original fseek($handle,$pos).
> >>
> >>
"Richard Heyes" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>> Thanks for the heads up on fgetc() incrementing by one. I hadn't actually
>> tested that code yet, I was using the original fseek($handle,$pos).
>>
>> strpos would be ideal but it needs to work on a string and not a fi
Thanks for the heads up on fgetc() incrementing by one. I hadn't actually
tested that code yet, I was using the original fseek($handle,$pos).
strpos would be ideal but it needs to work on a string and not a file - I
don't want to load a 100Mb file into memory if I don't have to. Perhaps I
shou
Thanks for the heads up on fgetc() incrementing by one. I hadn't actually
tested that code yet, I was using the original fseek($handle,$pos).
strpos would be ideal but it needs to work on a string and not a file - I
don't want to load a 100Mb file into memory if I don't have to. Perhaps I
shoul
fseek($handle, 1, SEEK_CUR); // or fseek($handle, $pos)
$t = fgetc($handle);
This probably won't help you, but given a quick glance, it looks like you're
incrementing the file pointer by 2 positions on each iteration of your while
loop. The fgetc() function returns the character at the
8 matches
Mail list logo