You are not logged in.
Announcement
Unanswered posts
|
right
"stupid index 0"
thanks
For the last question, the max value in the Loop type must be (length - 1). You have 4 sheets : 0, 1, 2 et 3 ![]()
hi all,
all is in the title
Because when i try to read all sheet (by selecting tFileInputExcel's checkbox) just first one is readed !
Names of them are none defined and can be anything.
I've tried with regex ".*" without success.
So i've made a simple routine that return a string array
public static String[] getExcelSheetList(String path){
String[]sheetsName = null;
try{
//System.out.println(path.split(".")[1]);
if(path.substring(path.indexOf(".")+1, path.length()).equalsIgnoreCase("xls")){
// liste des noms de feuilles
sheetsName = workbook.getSheetNames();
}// enf if
}
catch(ArrayIndexOutOfBoundsException e){e.printStackTrace();} catch (JXLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return sheetsName;
}I do a loop on this array and iterate in tFileInputExcel.
It's work (all lines are appended in my delimited file) but is there a easiest and better way to do this ??
I still have an error by this way
java.lang.IndexOutOfBoundsException: Index: 4, Size: 4
thanks for your help and suggestion
regards
laurent