Keyang / node-csvtojson

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

Column filter #50

Closed hodiapa closed 9 years ago

hodiapa commented 9 years ago

How to filter only a desired set of columns during CSV to JSON conversion. So I have columnA, columnB, ColumnC. And I would like to display only ColumncC in the JSON file.

How to go about it.

Raising an issue as I didn't find any mailing list. Thanks~

Keyang commented 9 years ago

use omit parser to exclude the column you do not want. see here : https://github.com/Keyang/node-csvtojson#default-parsers so in your CSV header you will have omitcolumnA, omitcolumnB, ColumnC Does this solve your problem?

~Keyang

hodiapa commented 9 years ago

Is there a way to do this using the csvtojson api rather than manually changing the header row? If not this could be a very good feature enhancement to have to the library

Keyang commented 9 years ago

True. I will add this in road map. Thanks for the suggestion.

~Keyang