Location: PHPKode > scripts > Txt Xtrator > examples/file.php
<?php
/*
 * TxtXtrator - arquivo de exemplo
 * Mostra como utilizar o método file()
 */
function noSpace($string){
    $string = trim($string);
    return $string;
}

require '../TxtXtrator.class.php';
$TxtXtrator = new TxtXtrator();
$filename = 'CREDOR.TXT';
$TxtXtrator->loadFile($filename);
$TxtXtrator->loadTpl('credor.json');
$TxtXtrator->setCsvSeparator(';');
$TxtXtrator->xtract();
$TxtXtrator->setOutputType('csv');
$TxtXtrator->setLineBreakType('windows');
$TxtXtrator->output();
$TxtXtrator->file('exemplo.txt');

echo file_get_contents('exemplo.txt');
?>
Return current item: Txt Xtrator