package xslx;
import org.apache.poi.xssf.usermodel.*;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Cell;
import java.io.*;
public class pro {
String[][] mat=new String[500][500];
Cell cc;
public static void main(String[] args) {
pro test=new pro();
}
pro(){
String file;
int number=0;
int maxx=10;
int maxy=10;
file="data/2.xlsx";
try{
FileInputStream is = new FileInputStream(file);
XSSFWorkbook wb = new XSSFWorkbook(is);
Sheet sh = wb.getSheetAt(number);
int s,sx,j,h;
String bb;
for(s=1;s<maxy+1;s++){
for(sx=1;sx<maxx+1;sx++){
mat[s][sx]="";
}}
for(s=1;s<maxy+1;s++){
Row row = sh.getRow(s-1);
j=0;
if(row==null)j=100;
if(j<50){
for(sx=1;sx<maxx+1;sx++){
cc = row.getCell(sx-1);
h=0;
if(cc==null)h=100;
if(h<50){
int type =cc.getCellType();
bb="";
if(type==1)bb=cc.getStringCellValue();
if(type==0)bb=""+cc.getNumericCellValue();
mat[s][sx]=bb;
}
}
}
}
} catch (Exception e) {e.printStackTrace();}
}
}
最終更新:2016年06月13日 04:35