csv-column-reorder
I often receive large CSV files for importing to postgre databases. I often struggle with random column orders of the csv files. Therefore I descided to write this module and learn node by the way. This module allows to rearrange the columns of csv files, since tools like Excel struggle with large csv files.
usage:
var csv = ; var filePath = processargv2; // path to your filevar newOrder = JSON; //'{"0": 1, "1": 0}' will exchange the second column of a csv file with the firstvar separator = processargv4; // default is ';' var { if err console; else console; };csv;
As this snippet is part of the starting point of the module it can be executed by command line.
running tests
I'm using mocha, proxyquire, mock-fs and sinon for my tests.