Possible Bug with bigger files? #4

Closed
jochenonline opened this Issue Sep 3, 2012 · 2 comments

Comments

Projects
None yet
2 participants
@jochenonline

Is it possible that there is a bug in the new version? I have problems in reading bigger files which I have processed successfully in the past. They all stop reading after 900 - 2100 lines by returning reader.hasNextLine() === false. The files are > 100.000 lines long. Each file stops at a different line, but per file the stopping line is the same.

Here is my code:

lineReader.open('bigfile.txt', function(reader) {
    var process_line, i = 0;

    process_line = function(line) {
        console.log(i, line);
        i += 1;
        if( reader.hasNextLine() ) {
            reader.nextLine( process_line );
        }
    };
    reader.nextLine( process_line );
});

If I remove the if like so

        // if( reader.hasNextLine() ) {
            reader.nextLine( process_line );
        // }

the whole file is process, but the function crashes (of course) when the end of file is reached.

Any ideas?

Thanks and best regards,
jochenonline

@nickewing

This comment has been minimized.

Show comment Hide comment
@nickewing

nickewing Sep 5, 2012

Owner

Thanks for pointing this out. It should be fixed now. Please tell me if you have any more problems.

Owner

nickewing commented Sep 5, 2012

Thanks for pointing this out. It should be fixed now. Please tell me if you have any more problems.

@jochenonline

This comment has been minimized.

Show comment Hide comment
@jochenonline

jochenonline Sep 5, 2012

Works! Thank you!

Works! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment