1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
echo 'Begin process<br/>';
flush();
$a = time();
$file = file("repository/SN1_20Mo.csv");
echo "time to read 20Mo file: ".(time() - $a)."<br/>";
flush();
$a = time();
$unrelevantLines = array();// il y a une dizaine de lignes (à peine quelque octets)
foreach($file as $key=>$line) {
if(preg_match("/^[0-9a-z-A-Z]/", $line) != 0) {
$file[$key] = explode(";", $line); // c'est ici que ça plante à un moment donné
} else {
array_push($unrelevantLines, $key);
}
}
foreach($unrelevantLines as $index) {
unset($line[$index]);
}
echo "time to read csv lines of this 20Mo file: ".(time() - $a)."<br/>";
flush(); |
Partager