aspose file tools*
The moose likes Java in General and the fly likes Unable to recognize OLE stream while upload CSV Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Unable to recognize OLE stream while upload CSV" Watch "Unable to recognize OLE stream while upload CSV" New topic
Author

Unable to recognize OLE stream while upload CSV

Ragupathirajan Venkatesan
Ranch Hand

Joined: Aug 18, 2010
Posts: 62
Dear All,

I am getting the below exception while uploading the csv file. Please provide your inputs

jxl.read.biff.BiffException: Unable to recognize OLE stream
at jxl.read.biff.CompoundFile.<init>(CompoundFile.java:111)
at jxl.read.biff.File.<init>(File.java:113)
at jxl.Workbook.getWorkbook(Workbook.java:250)
at jxl.Workbook.getWorkbook(Workbook.java:235)
at
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14269
    
  21

It looks like you are using an API to read Excel documents (*.xls), which you are trying to use to read a CSV file.

CSV files are not in the same format as *.xls files. You can't use an API that expects a file in *.xls format to read a CSV file.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19720
    
  20

Why are you using JExcelAPI (JXL) for reading CSV files? JXL is meant for Excel (.xls) files. Use a proper CSV library for reading CSV files; you can find several on our AccessingFileFormats FAQ page. And yes, I am aware that they are grouped under Excel there, but that's because Excel is usually the default application for CSV files. That doesn't make them proper Excel files.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Ragupathirajan Venkatesan
Ranch Hand

Joined: Aug 18, 2010
Posts: 62
Hi Friend,

Thanks a lot for your reply. It really helps me. I will look at the possible library to read csv and comeback if any issue. Thanks
 
 
subject: Unable to recognize OLE stream while upload CSV