forked from sheetjs/sheetjs
13 lines
366 B
JavaScript
13 lines
366 B
JavaScript
|
#!/usr/bin/env sjs
|
||
|
|
||
|
var XLSX = require('../../xlsx.js');
|
||
|
|
||
|
var io = require('io');
|
||
|
var file = io.open("sheetjs.xlsx", "rb");
|
||
|
var strs = [], str = "";
|
||
|
while((str = file.read()).length > 0) strs.push(str);
|
||
|
var data = (Buffer.concat(strs.map(function(x) { return new Buffer(x); })));
|
||
|
|
||
|
var wb = XLSX.read(data, {type:"buffer"});
|
||
|
console.log(wb.Sheets[wb.SheetNames[0]]);
|