>>596
preg_match("/(\d{4})(\d{2})\.dat/", $filename, $m);
$year=$m[1];
$month=$m[2];