This repository has been archived by the owner on Dec 4, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
version bump 0.0.3: basic sylk support
- Loading branch information
1 parent
4537481
commit 80cda54
Showing
16 changed files
with
127 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
language: node_js | ||
node_js: | ||
- "0.11" | ||
- "0.10" | ||
- "0.8" | ||
before_install: | ||
- "npm install -g mocha" | ||
- "npm install blanket" | ||
- "npm install xlsx xlsjs" | ||
- "npm install coveralls mocha-lcov-reporter" | ||
before_script: | ||
- "make init" | ||
- "cd test_files; make all; cd -" | ||
after_success: | ||
- "make coveralls-spin" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env node | ||
|
||
var HARB = require('../'); | ||
|
||
console.log(HARB.readFile(process.argv[2]).Sheets.Sheet1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
HARB.version = '0.0.2'; | ||
HARB.version = '0.0.3'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,30 @@ | ||
var sylk_to_sheet = function(f) { throw new Error('SYLK files unsupported'); }; | ||
/* TODO: find an actual specification */ | ||
var sylk_to_aoa = function(str) { | ||
var records = str.split(/[\n\r]+/), R = -1, C = -1, ri = 0, rj = 0, arr = []; | ||
for (; ri !== records.length; ++ri) { | ||
var record = records[ri].trim().split(";"); | ||
var RT = record[0], val; | ||
if(RT !== 'C' && RT !== 'F') continue; | ||
for(rj=1; rj<record.length; ++rj) switch(record[rj].charAt(0)) { | ||
case 'Y': | ||
R = parseInt(record[rj].substr(1))-1; C = 0; | ||
for(var j = arr.length; j <= R; ++j) arr[j] = []; | ||
break; | ||
case 'X': C = parseInt(record[rj].substr(1))-1; break; | ||
case 'K': | ||
val = record[rj].substr(1); | ||
if(val.charAt(0) === '"') val = val.substr(1,val.length - 2); | ||
else if(val === 'TRUE') val = true; | ||
else if(val === 'FALSE') val = false; | ||
else if(+val === +val) val = +val; | ||
arr[R][C] = val; | ||
break; | ||
} | ||
} | ||
return arr; | ||
}; | ||
|
||
var sylk_to_sheet = function(str) { return aoa_to_sheet(sylk_to_aoa(str)); }; | ||
|
||
var sylk_to_workbook = function (str) { return sheet_to_workbook(sylk_to_sheet(str)); }; | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.