Skip to content

emolla/excel-classificator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

### to_csv(options, callback(err, response)) Convert and normalize spreadsheet file in csv file filtering bad headers

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)}

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.

About

This library classifies the spreadsheet input file using a mapping with the desired column names

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published