Keyang / node-csvtojson

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

ignoreEmpty: true and checkType: true does not work if set output is csv format #466

Open hacker0limbo opened 1 year ago

hacker0limbo commented 1 year ago

Following config is not working properly when setting the output to csv

const csvtojson = require('csvtojson');
csvtojson({
  noheader: true,
  output: 'csv',
  ignoreEmpty: true,
  checkType: true,
})
  .fromFile(xxx)
  .then((rowData) => {
    // rowData still contains empty value(empty string) and all data is string format
    // however if switched to json output everything works fine
  })
manoger commented 1 year ago

I'm facing the same behaviour, I have thousands of lines like ;;;; and they are being parsed

hacker0limbo commented 1 year ago

I'm facing the same behaviour, I have thousands of lines like ;;;; and they are being parsed

Just use other lib instead. I doubt they won't check and fix issue frequently...