title: Storing values in an array from excel
body: <p>I'm using jexcel to store values from an excel sheet to a java array. But i'm getting only null values. Could you please tell me what i'm doing wrong?</p>
  
  <pre><code>package com.tcs.urls;
  
  import java.io.File;
  
  import jxl.Sheet;
  import jxl.Workbook;
  
  public class ReadExcel {
  
  
      void readExcelSheet(String destfile) {
          File excelSheet=null;
  
          try {
                excelSheet= new File(destfile);
                Workbook wb=Workbook.getWorkbook(excelSheet);
                int s=wb.getNumberOfSheets();
                Sheet sh=wb.getSheet(0);
                int r=sh.getRows();
                String video_url[][]=new String[r][s];
                String image_url[][]=new String[r][s];
                for(int sheetNo=0;sheetNo&lt;s;sheetNo++)
                {
                    Sheet sheet=wb.getSheet(sheetNo);
                    int columns=sheet.getColumns();
                    int rows=sheet.getRows();
  
                    String data1,data2;
                    if(columns==2) {
                       for(int row=0;row&lt;rows;row++)
                    {   String x=sheet.getCell(0, row).getContents();
                        if(x!="")
                        {   data1=sheet.getCell(1, row).getContents();
                            data2=sheet.getCell(2, row).getContents();
                            video_url[row][sheetNo]=data1;
                            image_url[row][sheetNo]=data2;
                        }
                    } }
  
                }
                for(int i=0;i&lt;s;i++) {
                    for(int j=0;j&lt;r;j++) {
                        System.out.print(video_url[j][i]+"\t");
                        System.out.print(image_url[j][i]+"\n");
                    }
                    System.out.println("\n");
                }
  
          }catch(Exception ioe) {
              ioe.printStackTrace();
          }
      }
  }
  </code></pre>