Get your CodeRanch badge!*
The moose likes Other JSE/JEE APIs and the fly likes Determining the File Format Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Determining the File Format" Watch "Determining the File Format" New topic
Author

Determining the File Format

Monu Tripathi
Rancher

Joined: Oct 12, 2008
Posts: 1369

A friend of mine is working on light weight client library(for Android Mobile platform) for working with MS-Excel files. He wants to target BIFF and Office 2003 XML formats first.

Question: How to determine the format of an xls file(biff or XML)?

Thanks.


[List of FAQs] | [Android FAQ] | [Samuh Varta]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39578
    
  27
The office 2003 XML formats consist of an actual XML file - so trying to parse it (and not getting an exception) would indicate that it is in XML format.

Are people still using that format? My impression was that the Office 2007 format (which is a ZIP file) was now mainly being used, if not still the old binary format.

I don't think anything that handles the binary Office formats will be able to be called "light-weight" - it's quite a complex format.


Ping & DNS - updated with new look and Ping home screen widget
Monu Tripathi
Rancher

Joined: Oct 12, 2008
Posts: 1369

Ulf: Many thanks for reply.

I think his ultimate goal is to go for OOXML format which is used in office 2007 but he is unsure of how to ZIP the xml created in Office compression format.

Can you please advise?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39578
    
  27
He doesn't need to ZIP it, he needs to UNZIP it. That's where the java.util.zip package comes in.
Monu Tripathi
Rancher

Joined: Oct 12, 2008
Posts: 1369

UnZip, while reading the (OOXML formatted) file and Zip, when writing right? He is confused about writing to a zip stream...sorry for not making it clear in the earlier post.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39578
    
  27
You said this was for an Android application, right? So he should use something that's available in Android - like the java.util.zip package, which can both zip and unzip.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Determining the File Format
 
Similar Threads
non-english
API For File Download
how to convert PPT file to XML file
XSL to transform XML to HTML format
If you made a java server , what would you name it?