by userbinator · 10y ago · 0 comments
They were designed to be fast on very old computers. For the early versions of Excel for Windows, 1 MB of RAM was a reasonable amount of memory, and an 80386 at 20 MHz had to be able to run Excel comfortably.
To me, this suggests the opposite --- a complicated format would be difficult to parse efficiently. I found this document:
https://www.openoffice.org/sc/excelfileformat.pdf
...which shows that it's basically TLV, so for simple data extraction it doesn't seem so difficult after all. For example, if you're just after cell values, you don't have to care about fonts, printing, and other formatting info.
The old format had some shortened names which made stuff really hard to follow to the uninitiated. [2]
1. http://www.ecma-international.org/publications/standards/Ecm... (1st edition, part 4 for section headers.)
2. https://msdn.microsoft.com/en-us/library/office/dd921346(v=o...
Apache's library called it HSSF, Horrible Spreadsheet Format. You make the call.
:)
https://en.wikipedia.org/wiki/Apache_POI was a fun read
HPSF (Horrible Property Set Format) HSMF (Horrible Stupid Mail Format) DDF (Dreadful Drawing Format)
It stood for:
"Poor Obfuscation Implementation".
What makes them fast is that they were designed to not require parsing at all. They are essentially a memory dump and can be loaded with a simple mmap. But if you want to "understand" what that data means, then you have a long and complex road ahead of you.