node-csvtojson icon indicating copy to clipboard operation
node-csvtojson copied to clipboard

Ignore empty rows.

Open sharmankita opened this issue 3 years ago • 1 comments

I was using flag ignoreEmpty for this, But somewhere we have a static code flow that all object will have same number of keys , and this flag is causing error for that.

Is there any way to ignore only completely empty rows not rows with values in some column.

EX :

a,b,c
test1,2,3

test2,3,
test3,4,5

this is giving me [{a :test1 , b : 2 , c:3} , {a :test2 , b : 3 }, {a :test3 , b : 4 , c:5}] but i want this

[{a :test1 , b : 2 , c:3} , {a :test2 , b : 3 , c:""}, {a :test3 , b : 4 , c:5}] is there any way to achieve this?

sharmankita avatar Sep 26 '22 08:09 sharmankita

Remove ignoreEmpty option. The result will get you want.

Kyaw-Zin-Thant avatar Dec 23 '22 04:12 Kyaw-Zin-Thant