package poi6;
import java.io.*;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.*;
public class pro {
public static void main(String[] args) {
pro test=new pro();
}
pro(){
try{
int s;
FileInputStream is = new FileInputStream("ren.xls");
Workbook wb = new HSSFWorkbook(is);
Sheet sh = wb.getSheetAt(0);
for(s=1;s<50;s++){
Row row = sh.getRow(s);
Cell cell = row.getCell(3);
if (cell == null)cell = row.createCell(1);
int type =cell.getCellType();
String bb;
double n;
n=0;
bb="";
if(type==1)bb=cell.getStringCellValue();
if(type==0)n=cell.getNumericCellValue();
System.out.println(type+","+bb+","+n);
}
} catch (Exception e) {e.printStackTrace();}
}
}
最終更新:2014年01月18日 10:30