aspose file tools*
The moose likes Other JSE/JEE APIs and the fly likes  Unable to read entire header Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark " Unable to read entire header" Watch " Unable to read entire header" New topic
Author

Unable to read entire header

Kousik Majumder
Ranch Hand

Joined: Sep 30, 2007
Posts: 227
Hi All,

I am trying to read an excel file created from Linux Ubuntu machine. I am using POI api to read. But I am getting below error.
Please help.

java.io.IOException: Unable to read entire header; 92 bytes read; expected 512 bytes
at org.apache.poi.poifs.storage.HeaderBlock.alertShortRead(HeaderBlock.java:226)
at org.apache.poi.poifs.storage.HeaderBlock.readFirst512(HeaderBlock.java:207)
at org.apache.poi.poifs.storage.HeaderBlock.<init>(HeaderBlock.java:104)
at org.apache.poi.poifs.filesystem.POIFSFileSystem.<init>(POIFSFileSystem.java:138)
at com.test.ReadExcel.ReadCSV(ReadExcel.java:28)


Java Code:- The same code is working for other excel file created in windows.



Any help is appreaciated.

Thanks,
Kousik


Thanks in Advance,
Kousik
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18141
    
    8

Kousik Majumder wrote:I am trying to read an excel file created from Linux Ubuntu machine...

Java Code:- The same code is working for other excel file created in windows.



Then to me, the most likely source of the problem is that the files created in Windows are well-formed and the file created in Linux is not. Which means that looking at the code which reads those files isn't going to be helpful at all. You have to look at the process which produces them.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unable to read entire header
 
Similar Threads
excel sheet data insertion
how to read data from excel i store it in database table
Read Excel Sheet Using Java
Java Code to export data to Excel
How to import data from Excel sheet to database using java??