nickewing / line-reader

Asynchronous line-by-line file reader for node.js
MIT License
453 stars 75 forks source link

Only returns the last line of the file #13

Closed arisolt closed 8 years ago

arisolt commented 10 years ago

The following code:

var linereader = require('line-reader');

linereader.eachLine('test_data', function(line, last) {
    console.log(line);
});

with test_data:

aa
bb
cc
dd

only returns dd in the console.

arisolt commented 10 years ago

UPDATE: The file test_data was initially created using Excel as a .csv. I copy/pasted the contents into a new file, and it is now working fine...

jedwards1211 commented 9 years ago

This may have been a line separator issue. I just contributed a PR that supports line endings from any platform, let me know if that works for the data straight out of Excel.

nickewing commented 8 years ago

Tested in current version. Seems to have been fixed at some point.