Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible Bug with bigger files? #4

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

Possible Bug with bigger files? #4

jochenonline opened this issue Sep 3, 2012 · 2 comments

Comments

@jochenonline
Copy link

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
Copy link
Owner

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

@jochenonline
Copy link
Author

Works! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants