Search code examples
androidexcelexcel-2003file-formatxls

How to determine the format of Excel file in Java?


I am working on a light weight Java client library for Android mobile platform that can read and write to Excel files in .xls(BIFF) and Office 2003 XML format.

No sooner we decided to start than we got stuck with a basic question. How do we determine the format of the excel files in Java?


Solution

  • I guess I would just parse the file using an XML parser and if I dont get an Exception I will infer that it is an XML.