Re: fgets function for very large files
| From: | shahrzad khorrami | Date: | Mon, 25 May 2009 10:43:20 +0000 |
| Subject: | Re: fgets function for very large files | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-293122@lists.php.net to get a copy of this message | ||
in the following loop:
$row = 1;
while (($line = fgets($handle, 1024)) !== FALSE )
{
$line = str_replace(SEPARATOR, ",", $line);
$data = explode(",", $line);
$row++;
}
How put 1000 by 1000 lines of csv file to new ones?
and you know I think this works slowly
what do you recommend?
Thanks in advance,
shahrzad
>>
>>
> 1: http://php.net/fgetcsv
> 2: if( ($row % 10000) == 0 ) {
> 3: http://php.net/fputcsv
>
>
>