アットウィキロゴ

POI x

package miti;
 
import java.io.*;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.*;
 
public class pro {
 
    int s,sx;
    double[][] point=new double[200][200];
  String[] name=new String[200];
 
    public static void main(String[] args) {
        pro test=new pro();
    }
   pro(){ 
 
       int n1,n2;
 
    try{
 
         FileInputStream is = new FileInputStream("ren.xls");
     Workbook wb = new HSSFWorkbook(is);
      Sheet sh = wb.getSheetAt(0);
 
 
 
      for(s=3;s<153;s++){
      Row row = sh.getRow(s);
 
      Cell cellx = row.getCell(1);
 
      String bc=cellx.getStringCellValue();
 
      name[s-2]=bc;
 
 
 
      for(sx=2;sx<74;sx++){  
      Cell cell = row.getCell(sx);
 
   if (cell == null)cell = row.createCell(1);
   int type =cell.getCellType();
 
   String bb;
   double n;     
   n=0.0;
        bb="no";
        if(type==1)bb=cell.getStringCellValue();
        if(type==0)n=cell.getNumericCellValue();
 
        n1=s-2;
        n2=sx-1;
 
        point[n1][n2]=n;
 
 
 
 
      }
      }
 
 
  } catch (Exception e) {e.printStackTrace();}
 
 
 
 
 
 
 
 
   }
 
 
 
 
}
 
最終更新:2014年01月20日 08:20