I am trying to parse a ~ 1 GB tab delimited file.
Where I run the script, I get:
Fatal error: Allowed memory size of 1895825408 bytes exhausted (tried to allocate 1029206974 bytes) ...
My script at the moment is simple:
$file = file_get_contents('allCountries.txt') ; $file = str_replace(array("\r\n", "\t"), array("[NEW*LINE]", "[tAbul*Ator]"), $file) ;
I set the memory limit in php.ini to -1, which then gives me:
Fatal error: Out of memory (allocated 1029963776) (tried to allocate 1029206974 bytes)
Is it possible to partially open the file and then go to the next part so that less memory is used up at a time?
imperium2335
source share