>
java code read xls file
Welcome, Guest

by Nitin on Saturday, 18 July 2009
java code read xls file


import java.util.*;
import java.io.*;
import jxl.*;


public class javaReadExcel
{
    public static void main(String st[])
    {
        ArrayList a = javaReadExcel.readFile("testJava.xls");
    }

    public ArrayList readFile(String fileName)
     {
         ArrayList dataList=null;
         try
         {
             dataList=new ArrayList();
             Workbook workbook = Workbook.getWorkbook(new File("testJava.xls"));
             String sheetName[]=workbook.getSheetNames();
             Sheet sheet;
             Cell xlsCell;
             Cell[] cell;

             for(int p=0; p<sheetName.length; p++)
             {
                 sheet = workbook.getSheet(p);
                 for(int i=0; i<sheet.getRows(); i++)
                 {
                     cell = sheet.getRow(i);
                     for(int j=0; j<cell.length; j++)
                     {
                         xlsCell = sheet.getCell(j,i);
                         //dataList.add(xlsCell.getContents().toString());
                         System.out.println(xlsCell.getContents().toString());
                     }
                 }
             }
         }
         catch(Exception exec)
         {
             System.out.print("Exception "+exec);
         }
//     return dataList;
     }

 }


Topic Normal Java code to remove repeated element from an array
by Charan on 07/21/2009 10:36

 

     Integer repArr = {1,2,3,2,4,5,6,2,6,1};


          ArrayList<Integer> integerArrayList = new ArrayList<Integer>();
          for( i=0; i<repArr.length;i++){
              if(!integerArrayList.contains(repArr))
              {
                  integerArrayList.add(repArr);
              }
          }
          String[] refinedIntegerArray = {};
          refinedIntegerArray = integerArrayList.toArray(new String[0]);
          
          System.out.println("Array after removing Duplicate element:  ");
          
          for( i=0; i<refinedIntegerArray.length;i++){
              System.out.println(refinedIntegerArray);
          }
          
         



Blogger Image
My Blog Title

Product Engineering, software engineering company, Product Development, Product Migration, Product Re-engineering, Product Maintenance, Product Testing Commercial Application Development, Business Software development, commercial software for startups, Application Support and Maintenance, software testing Product Maintenance, Outsource product maintenance, product support and maintenance Product Migration, Product Re-engineering, product re-engineering services Product Research, Product Engineering, UI Prototyping Services Software Testing Services, Quality Assurance services, professional software testers, Load Testing, Functional Testing, Cross Platform, Browser Testing, Test Automation, Testing Tools, software quality analysis Functional Testing Services, software quality analysis, Software Testing Services, Application Testing Services, Functional Testing Types Automated Testing, Automated Testing Services, automation testing, test script development, Automation Test Tools, outsource automation testing Load Testing, Performance Testing Services, Load Testing Tools Offshore Software Development, Outsource software services, offshore outsourcing services, offshore software development services, IT outsourcing services, software quality assurance services, Offshore IT services, Custom Application Development Services, Offshore Product Engineering Benefits of IT Outsourcing, Offshore Software Development companies, offshore software development firms Outsource planning, IT outsourcing, IT development services, offshore IT companies, offshore software development Offshore Software Development, Outsource software services, offshore outsourcing services, offshore software development services, IT outsourcing services, software quality assurance services, Offshore IT services, Custom Application Development Services, Offshore Product Engineering Offshore Software Development, Outsource software services, offshore outsourcing services, offshore software development services, IT outsourcing services, software quality assurance services, Offshore IT services, Custom Application Development Services, Offshore Product Engineering