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 > > >