This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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
    
    1

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: 41124
    
  45
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 - my free Android networking tools app
Monu Tripathi
Rancher

Joined: Oct 12, 2008
Posts: 1369
    
    1

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: 41124
    
  45
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
    
    1

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: 41124
    
  45
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Determining the File Format
 
Similar Threads
how to convert PPT file to XML file
If you made a java server , what would you name it?
non-english
API For File Download
XSL to transform XML to HTML format