Keyang / node-csvtojson

Blazing fast and Comprehensive CSV Parser for Node.JS / Browser / Command Line.
MIT License
2.02k stars 270 forks source link

TypeError: csvParser.getEol is not a function #63

Closed ataulmustafa closed 8 years ago

ataulmustafa commented 8 years ago

I am trying to every row by using the function "record_parsed". It is giving me the error "TypeError: csvParser.getEol is not a function"

Here is the code I am using

var fs = require("fs");
var converter=new require("csvtojson").Converter({
    constructResult:false,
    workerNum:4,
    eol: '\n'
});
var fileStream = fs.createReadStream("./app/controllers/file.csv");
csvConverter.on("record_parsed",function(resultRow,rawRow,rowIndex){
    console.log(resultRow); //here is your result json object
});
fileStream.pipe(converter);

Please note that it works fine when I use "end_parsed" technique which emits json once parsing of whole file is done. Also I omitted the eol parameter from configuration to check if it works, but not succeeded.

Kindly let me know about the solution.

Keyang commented 8 years ago

Hi, I cannot reproduce this issue. I think it is specific to your data. Can you please upload the csv file you have problem with to https://fileota.com and share me the link? Also what version of csvtojson you are using?

~Keyang

Keyang commented 8 years ago

Close due to no activity