goodby / csv

Goodby CSV is a high memory efficient flexible and extendable open-source CSV import/export library for PHP 5.3. 1. Memory Management Free This library designed for memory unbreakable. It will not be accumulated in the memory whole rows. The importer read CSV file and execute callback function line by line. 2. Multibyte support This library supports mulitbyte input/output: for example, SJIS-win, EUC-JP and UTF-8. 3. Ready to Use for Enterprise Applications Goodby CSV is fully unit-tested. The library is stable and ready to be used in large projects like enterprise applications.
MIT License
953 stars 147 forks source link

Bug fix: error when the last line is empty #22

Closed emmanuelgautier closed 10 years ago

gnutix commented 10 years ago

@goodby @suin @reoring ping While waiting for the PR to get merge, you can always do that :

$interpreter->addObserver(
    function (array $row) {

        // Skip empty lines
        if (empty($row) || (1 === count($row) && empty($row[0]))) {
            return;
        }

        // do something with $row
    }
);
$interpreter->unstrict();

$lexer->parse($filePath, $interpreter);
gnutix commented 10 years ago

@reoring Thanks! Could you also please tag the application ? :)