I found this link: file sigs.
starting with: D0 CF 11 E0 A1 B1 1A E1
DOC, DOT, PPS, PPT, XLA, XLS, WIZ Microsoft Office applications (Word, Powerpoint, Excel, Wizard) (See also Word, Powerpoint, and Excel "subheaders" at byte offset 512)
So evidently the "magic" at the beginning just says that this is a MS Office document. There is an additional field at byte offset 512 that gives the sub-type. There appears to be some freeware apps at that link that will figure this out. If that fails, I guess you could do some hacking to figure out what the difference is at byte 512 yourself.

Update: I did some hacking around on some of my files. I suspect that different versions of MS Office have different formats - I'm not finding the signatures that some folks claim should be there in my Excel 2000 file - but maybe my brain isn't counting byte offsets right this late evening! However, I did notice that
57006F00 72006B00 62006F00 6F006B00 W.o.r.k.b.o.o.k
appears in my .XLS file. So maybe worst case, there is some adhoc string that can be found to search for that will give you the answer you need?


In reply to Re: How to recognize Word and XLS files by Marshall
in thread How to recognize Word and XLS files by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.