Skip to content

Instantly share code, notes, and snippets.

SheetJSDev

View GitHub Profile
View update_uzip.sh
#!/bin/bash
set -o pipefail
UZIPVER=$(date "+0.%Y%m%d.0")
# Remove and re-clone
rm -rf UZIP.js
git clone https://github.com/photopea/UZIP.js/
cd UZIP.js
# Generate package.json
@SheetJSDev
SheetJSDev / rich_text_stress.html
Created Oct 7, 2014
rich_text_stress.xlsx clipboard from Excel 2011
View rich_text_stress.html
<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<meta name=ProgId content=Excel.Sheet>
<meta name=Generator content="Microsoft Excel 14">
<link id=Main-File rel=Main-File
@SheetJSDev
SheetJSDev / main.js
Created Aug 22, 2014
XLSX writing custom date formats
View main.js
/* this sample was run in nodejs */
var XLSX = require('xlsx');
/* build up a very simple workbook */
var wb = {
SSF: XLSX.SSF.get_table(),
SheetNames: ["Sheet1"],
Sheets: {
Sheet1: {
'!ref': 'A1:A1',
View xlsx2socialcalc.js
/* xlsx2socialcalc.js (C) 2014 SheetJS -- http://sheetjs.com */
/* License: Apache 2.0 */
/* vim: set ts=2: */
var sheet_to_socialcalc = (function() {
var header = [
"socialcalc:version:1.5",
"MIME-Version: 1.0",
"Content-Type: multipart/mixed; boundary=SocialCalcSpreadsheetControlSave"
].join("\n");
View number_format.xlsm.b64
UEsDBBQABgAIAAAAIQDpA5ilpwEAAGcHAAATAAgCW0NvbnRlbnRfVHlwZXNdLnhtbCCiBAIooAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADMld1O4zAQhe+R9h0i365ityygFWrKBbCXgAQ8wNSeNqaObXlMad+eSQoVu+q2VFSiN/lz5pxvbOt4cDFvXDHDRDb4SvRlTxTodTDWTyrx+PCn/C0KyuANuOCxEgskcTH8cTR4WESkgqs9VaLOOZ4rRbrGBkiGiJ5HxiE1kPk1TVQEPYUJquNe70zp4DP6XOZWQwwHVziGZ5eL6zl/XpJwuSgul/+1VpWAGJ3VkBlUtaNqbV1CRxsKZ978Q1e+kUmu7MSptpF+
View xlsx_ajax.js
/* generate CSV output for every sheet */
function to_csv(workbook) {
var result = [];
workbook.SheetNames.forEach(function(sheetName) {
var csv = XLSX.utils.make_csv(workbook.Sheets[sheetName]);
if(csv.length > 0){
result.push("SHEET: " + sheetName);
result.push("");
result.push(csv);
}
View write.js
/* require XLSX */
var XLSX = require('XLSX')
function datenum(v, date1904) {
if(date1904) v+=1462;
var epoch = Date.parse(v);
return (epoch - new Date(Date.UTC(1899, 11, 30))) / (24 * 60 * 60 * 1000);
}
function sheet_from_array_of_arrays(data, opts) {
You can’t perform that action at this time.