Results 1 to 4 of 4
  1. #1
    Join Date
    May 2010
    Posts
    2
    Rep Power
    0

    Default Problem with JXL: unable to read GSEA xls file

    Hi all,
    I'm using JXL libraries to read some output file of a bioinformatics software called GSEA. These files are all written in a folder produced by the sw.
    I've used the following code to read:

    WorkbookSettings wsUp = new WorkbookSettings();
    wsUp.setLocale(new Locale("en", "EN"));
    Workbook workbookUp=null;
    Sheet s = null;
    workbookUp = Workbook.getWorkbook(ee.filesUp.get(i),wsUp);
    s = workbookUp.getSheet(0);

    But Eclipse can't open the file returning:
    jxl.read.biff.BiffException: Unable to recognize OLE stream

    And the computation is stopped on getWorkbook line

    Someone knows when this error is present what I have to do on the excel file preliminarly?
    Thanks

  2. #2
    j2me64's Avatar
    j2me64 is offline Senior Member
    Join Date
    Sep 2009
    Location
    Zurich, Switzerland
    Posts
    962
    Rep Power
    6

    Default

    Quote Originally Posted by angeloulivieri View Post
    Hi all,
    I'm using JXL libraries to read some output file of a bioinformatics software called GSEA. These files are all written in a folder produced by the sw.
    I've used the following code to read:

    WorkbookSettings wsUp = new WorkbookSettings();
    wsUp.setLocale(new Locale("en", "EN"));
    Workbook workbookUp=null;
    Sheet s = null;
    workbookUp = Workbook.getWorkbook(ee.filesUp.get(i),wsUp);
    s = workbookUp.getSheet(0);

    But Eclipse can't open the file returning:
    jxl.read.biff.BiffException: Unable to recognize OLE stream

    And the computation is stopped on getWorkbook line

    Someone knows when this error is present what I have to do on the excel file preliminarly?
    Thanks

    i don't know what ee.filesUp.get(i) returns, but try

    File file = new File ("drive\\path\\yourfile.xls");
    workbookUp = Workbook.getWorkbook(file, wsUp);

    it would be easier if you post all your code. the reason for the BiffException could be, that the xls files has been written with an older version of excel 2003.
    Last edited by j2me64; 05-09-2010 at 12:01 PM.

  3. #3
    Join Date
    May 2010
    Posts
    2
    Rep Power
    0

    Default

    Quote Originally Posted by j2me64 View Post
    i don't know what ee.filesUp.get(i) returns, but try

    File file = new File ("drive\\path\\yourfile.xls");
    workbookUp = Workbook.getWorkbook(file, wsUp);

    it would be easier if you post all your code. the reason for the BiffException could be, that the xls files has been written with an older version of excel 2003.
    Sorry... the ee.filesUp.get(i) returns a File object and it works.
    I found that the problem is with these files.
    They are not excel files but csv files.
    So, the question is... exists a method to read csv files with JXL?

  4. #4
    j2me64's Avatar
    j2me64 is offline Senior Member
    Join Date
    Sep 2009
    Location
    Zurich, Switzerland
    Posts
    962
    Rep Power
    6

    Default

    Quote Originally Posted by angeloulivieri View Post
    So, the question is... exists a method to read csv files with JXL?

    looking at the jxl api i couldn't find any methods for reading csv files. but you can read csv files in java with the classes in java.io and then extract the values with a tokenizer and then build your workbook with jxl and put the readed values to the workbook.

Similar Threads

  1. Unable to Print more than 1 File
    By satyam000 in forum AWT / Swing
    Replies: 5
    Last Post: 11-24-2009, 06:59 AM
  2. Unable to access velocity.properties file from jar file
    By mjwoodford in forum New To Java
    Replies: 0
    Last Post: 10-09-2009, 02:46 PM
  3. Replies: 0
    Last Post: 02-11-2009, 10:53 AM
  4. Unable to read data from inputstream
    By renuka_anil in forum Java Servlet
    Replies: 0
    Last Post: 01-29-2009, 04:20 PM
  5. Replies: 5
    Last Post: 10-17-2008, 03:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •