Hi,
(Firstly sorry because also I have post this in forum "Core APIs Generics", but I have not answer)
Finally I am using the API jxl to read xls files.
I be able to open and obtain the content of any cell, but my problem is other.
I need to open a xls file (I will not know how many columns and rows it has) and
I need to know how many columns and rows it has.
My code to obtain the content of any cell is:
import jxl.Workbook;
import jxl.Sheet;
import jxl.Cell;
import jxl.*;
public class create{
private static File excelFile;
private int numCols;
private int numRows;
public static void main(String[] args) throws Exception {
Workbook book= Workbook.getWorkbook(new File("test.xls"));
Sheet mySheet= libro.getSheet(0);
Cell a1 = mySheet.getCell(0,0);
Cell b2 = mySheet.getCell(1,1);
System.out.println("Cell A1: " + a1.getContents());
System.out.println("Cell B2: " + b2.getContents());
//now I need to know how many cols and rows it has
read();
System.out.println("OK");
book.close();
}
final static void read(){
excelFile = new File("test.xls","r");
boolean cont = true;
System.out.println("OK READ");
}
}
How can I do?
Thanks