Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

parse-spreadsheet

For use in node.js. Run "npm install" to download the dependencies.

Easily parse a spreadsheet of .xls, .xlsx, .ods, .csv or .txt format either synchronously or asynchronously and return a matrix of string values corresponding to the table cell values.

If inputting an .xls, .xlsx, or .ods file, an optional value titled 'sheet' may be included. If not, then the function returns the data of the first sheet in the workbook.

If inputting an ascii file, an optional value titled 'delimiter' may be included. If not, the value defaults to a comma.

If inputting a buffer instead of a filename, you only have the synchronous option available to receive the return data.

Usage Examples:

var fs = require('fs');
var Spreadsheet = require('./index.js');
var data;

data = Spreadsheet.parse({filepath:'./file.xlsx'});

Spreadsheet.parse({filepath:'./file.csv'},function(err,retdata) {
  data = retdata;
});

var buffer = fs.readFileSync('./file.ods');
data = Spreadsheet.parse({filebuffer:buffer,sheet:'Sheet1'});

Spreadsheet.parse({filepath:'./file.txt',delimiter:'\t'},function(err,retdata) {
  data = retdata;
});

About

Parse a spreadsheet of .xls, .xlsx, .ods, or .csv quickly

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages