Post a reply

Write your message and submit

Options

Click in the dark area of the image to send your post.

Go back

Topic review (newest first)

kzone
2009-09-23 15:36:50

right smile

"stupid index 0"

thanks

François
2009-09-23 14:02:26

For the last question, the max value in the Loop type must be (length - 1). You have 4 sheets : 0, 1, 2 et 3 wink

kzone
2009-09-23 12:42:54

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

Code:

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

Board footer

Powered by FluxBB