

Pure JS in-browser Excel file parser - sheetjs
http://oss.sheetjs.com/#

======
davidbanham
Looking at all the special casing in your code, just for dates, I can imagine
the sweat and tears that have gone into producing this.

For anyone else looking for the code as I was, it's here:

[https://github.com/SheetJS](https://github.com/SheetJS)

[https://github.com/SheetJS/js-xlsx](https://github.com/SheetJS/js-xlsx)

[https://github.com/SheetJS/js-xls](https://github.com/SheetJS/js-xls)

~~~
sheetjs
The date processing is one of the worst-documented features, and there are
conflicts in the documentation between MS-XLS (XLS files), ECMA-376 (the
office open xml standard), and MS-XLSX (describing how excel deviated from
ECMA-376 -- yes, this exists and is pretty substantial).

To give an example, in some versions of excel `e` refers to the "era", which
is the year for US versions. However, the documentation and individual
implementations disagree as to what they actually mean:

Some versions treat "e" as the 4-digit year and "ee" as the 2 digit year.
Other versions treat "e" and "ee" as the 4-digit year. Others treat "e" and
"ee" as the 2-digit year

But the worst offender is format code 14, which actually depends on the client
calendar type, so you get different results in different versions of excel

------
hackula1
Awesome. Excel, PDF, and SQL Server are the 3 most obvious proprietary
integrations that have an enormous demand in javascript for commercial
application devs. There are partial solutions for each, but anyone who has
worked with them knows that they are miles away from the .Net and Java
equivalents. Most of the current solutions are clunky, have onerous
dependencies, or simply do not implement the common features that most people
need. Keep up the good work, and I hope this encourages similar projects!
These types of things are far from sexy in most of the web world, but turn
heads in the B2B space.

------
gliese1337
Sweet! A few years ago I had to write a bunch of JavaScript code for
manipulating Excel spreadsheets running in the Windows Scripting Host
environment
([https://github.com/gliese1337/PhoneReport);](https://github.com/gliese1337/PhoneReport\);)
WSH exposes an API for poking Excel from JScript, so I used that, but it makes
the code very non-portable- it'll only run on Windows machines with IE and
MSExcel installed. This could be really useful for genericizing it. Does it
support writing Excel files, or just reading?

~~~
sheetjs
Right now it's just reading. My approach is to attack reading first because it
is the harder problem (and exposes more features that need to be represented
in the internal format). Once I'm confident I've covered what needs to be
represented, then writing is easy.

Honestly, the biggest challenge here is trying to understand the full scope of
the problem -- its huge!

------
sixQuarks
This is faster than Excel itself.

------
jsmeaton
I broke it [http://imgur.com/dBKulsK](http://imgur.com/dBKulsK)

It first generated about 6 rows. I scrolled my mouse, it generated the rest. I
clicked around and scrolled a bit more, and the table moved around the page,
finally settling at the bottom of the page, losing my scrollbars for the page.

Chrome Version 31.0.1650.48 beta

~~~
sheetjs
There are some deeper issues with the grid component -- it's what I deserve
for not building it myself :/

The interactive demos [http://sheetjs.github.io/js-
xlsx](http://sheetjs.github.io/js-xlsx) and [http://sheetjs.github.io/js-
xls](http://sheetjs.github.io/js-xls) just show CSV output, which may be
easier to use if the grid is flaking

~~~
webXL
Might not be totally relevant here, but I highly reccomend Handsontable for
rendering/manipulating spreadsheets client side:
[http://handsontable.com](http://handsontable.com)

Edit: In fact I'm headed home right now to integrate your lib with that if no
one has already beat me to it!

~~~
webXL
Oops. That's what I get for commenting on my iPhone!

Handsontable is pretty active, so perhaps they can address your issues soon.

------
pvnick
This is really, really cool. I've been developing an excel spreadsheet that I
use for diet/nutrition tracking, which has all sorts of calculations across
various sheets. I thought there was no way this would be able to handle that,
but I was very impressed to see it handled it like a champ.

------
binarydreams
It is indeed quite lovely, I've even written a post on it recently -
[http://codetheory.in/parse-read-excel-files-xls-xlsx-
javascr...](http://codetheory.in/parse-read-excel-files-xls-xlsx-javascript/)

------
sheetjs
If anyone from GitHub is reading this: People are reporting 503 Backend is
unhealthy:

"Error 503 Backend is unhealthy

Backend is unhealthy

Guru Meditation:

XID: 2049396566

Varnish cache server"

------
sillysaurus2
The guy behind this is a brilliant hacker who has been working on this for a
long time. He also has a keen business sense. Anyone who's interested in
partnering with him should shoot him an email.

------
niix
The developer of this project is an amazing dude and brilliant programmer.

------
simantel
Glad to see this on HN! I just found SheetJS on Friday when I was looking for
an XLS/XLSX to JSON solution. Keep up the good work!

------
headgasket
kudos. This is something on which bridges will be built for the corporate
world.

------
gokulk
very nice. Wish I had this a couple of months back :). I had to spend a few
days with zip.js and async.js to get something like this and it accepted only
xlsx files.

------
motyar
Nice! Please add a "Upload" button too.

~~~
sheetjs
This is hosted on github
([https://github.com/sheetjs/sheetjs.github.io](https://github.com/sheetjs/sheetjs.github.io))
so I can't directly do it from there.

If you want to see an example using AJAX, the browser stress test
([http://oss.sheetjs.com/stress.html](http://oss.sheetjs.com/stress.html))
downloads files. DO NOT RUN ON YOUR PHONE -- THIS WILL DOWNLOAD MORE THAN
80MB!

