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

require '../TxtXtrator.class.php';
$TxtXtrator = new TxtXtrator();
$filename = 'CREDOR.CSV';
$TxtXtrator->loadFile($filename);
$TxtXtrator->loadTpl('credor.json');
$TxtXtrator->setFileType('csv');//Altera o fileType
$TxtXtrator->setCsvSeparator(';');
$TxtXtrator->xtract();
$TxtXtrator->setOutputType('sql');
$TxtXtrator->setLineBreakType('html');
$TxtXtrator->output();
$TxtXtrator->show();
?>
Return current item: Txt Xtrator