node wrapper for parsing spreadsheets. Supports xls, xlsx and csv files.
You can install this module using npm:
npm install excel-classificator
Requires python to be installed Requires xlrd and csv python modules pip install xlrd csv chardet
For system-specific installation view the Wiki
### to_csv(options, callback(err, response)) Convert and normalize spreadsheet file in csv file filtering bad headersArguments
- inFile - Filepath of the source spreadsheet
- outFile - Filepath of the source spreadsheet
Example
var excelclassificator = require('excel-classificator');
excelclassificator.to_csv({
inFile: 'file.xls', // xls, xlsx or csv extension
outFile: 'file.csv',
headerFields: {'billing': ['invoice', 'customer']}
}, function(err, response){
if(err) console.error(err);
consol.log(response);
});
Sample output
{'filetype': 'billing', 'numLines': numLines, 'outfile': os.path.abspath(args.outFile)}
There are unit tests in test/
directory. To run test suite first run the following command to install dependencies.
npm install
then run the tests:
grunt nodeunit
NOTE: Install npm install -g grunt-cli
for running tests.
Copyright (c) 2018 Quique Molla
Licensed under the MIT license.