excel-classificator
v0.0.9
Published
This library classifies the spreadsheet input file using a mapping with the desired column names.
Downloads
5
Readme
excel-classificator
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
API
Arguments
- 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)}
Running Tests
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.
License
Copyright (c) 2018 Quique Molla
Licensed under the MIT license.