Listing 30.8. Konwersja plików tekstowych do formatu XLS
$files = glob('dane-txt/*.txt');
foreach ($files as $f) {
    $nf = newfilename($f, '.xls');
    $parsed = parse_txt($f);
    $xls = array2xls($parsed);
    file_put_contents($nf, $xls);
}
