5 ms·
"An XLSX file is just a zip of xml files" is definitely a useful tidbit I will keep in my toolbox. I have clients at my day-job who send us Excel files all the
by AdmiralAsshat 9y ago
"An XLSX file is just a zip of xml files" is definitely a useful tidbit I will keep in my toolbox. I have clients at my day-job who send us Excel files all the time, even after explicitly cautioning them that the software only works with CSV.
- tdb7893 9y agoI know that at least .docx is a zip of xml also. As far as I know all of the .*x microsoft office formats are
- LeoPanthera 9y agoApple Numbers/Pages/Keynote documents are also zip files. They're not XML inside, but there is always a PDF preview in there.
- derefr 9y agoMore technically, those documents (and other Apple-spawned formats such as TextEdit's .rtfd) are "document bundles"—a directory hierarchy with a file extension or xattr that makes Launch Services treat it as a file. (The most well-known document bundles being macOS applications.) The storage frameworks used for accessing the contents of document bundles treat zip archives as transparent, so a document bundle is still a document bundle if you zip its contents and then give it the name of the original directory. And the reverse is also true: take, for example, an .epub (which is a zipped hierarchy of HTML files) and unzip its contents into a new directory. Name that directory "foo.epub". iBooks will happily open this "file." And it stores the .epubs you've imported into your iCloud Library this way on disk!
- subculture 9y agoCame to say something similar. There was a discussion a couple of weeks back on Metafilter about using this technique to modify comments within Word files. Handy knowledge to have: https://ask.metafilter.com/320606/Removing-timestamps-from-comments-in-Word-2016 https://ask.metafilter.com/320606/Removing-timestamps-from-c...
- TeMPOraL 9y agoAt my previous job we were working on a project that had a "propertiary" format that was just an XML file with a different file extension. At some point they asked to GZIP that XML before saving, though. So one day, I'm sitting at customer's office, working on something different, when they come and tell me they have this problem when the application is fed this particular file. I say to one of their devs, show me the file in text editor. They open it, and seeing garbage, say "it's no use". I immediately recognized the ZIP header, so I tell them, unzip it and open the output. Lo and behold, an XML content that let me debug their problem without running the application. Their technical people were impressed by my "wizardy". (Probably one of the reasons why they later asked my colleague to "encrypt" the file by running some binary transformation on the zipped XML before saving it.)
- murftown 9y agoAbleton Live .als files are also gzipped .xml files.
- mieseratte 9y agoI believe one can also embed images and possibly other content that end up in the embedded files. However, if you ever need to perform basic manipulation then all you need to care about is ZIP + XML.
- TeMPOraL 9y agoAFAIR the embedded files simply end up in the ZIP structure and are referenced by XML documents.
- mattmanser 9y agoIt's bloody complicated, weird XML though. So don't expect it to be easy. It's been like that since they switched over to xslx in 2007 or whatever.
- speps 9y agoIt is an ECMA spec though: https://msdn.microsoft.com/en-us/library/office/gg607163%28v=office.14%29.aspx https://msdn.microsoft.com/en-us/library/office/gg607163%28v...
- bkor 9y agoThe format used by Microsoft Office differs from the ECMA spec (how much I'm not sure). By default it saves it in a different format. You have to choose a Strict filetype for that format to be used. Meaning, most files out there don't follow the spec. Further, some bits of the spec are quite strange ("follow the behaviour of Word/WordPerfect"). See also https://en.wikipedia.org/wiki/Office_Open_XML https://en.wikipedia.org/wiki/Office_Open_XML.
- sfnrm 9y agoThis was a result of microsoft's settlement with the DOJ over the anti-trust case. Since then all microsoft docs end in .*x and are simply zipped xml files with an open format.
- TallGuyShort 9y agoYou'd be surprised how many proprietary-seeming formats are similar. I frequently work with one that's just a gzipped tarball of JSON files, but people freak out when I'm able to see what's inside it without the proprietary tooling it's used by.