我正在阅读一个Excel文档,使用并找到我另一个人的起首位置。
这是我的法典。
public static int CheckStartPosition(String filename,int Colno,String StartChar, int sheetno,int startpos) {
try {
Workbook workbook = new Workbook();
workbook.open(filename);
Worksheet worksheet = workbook.getWorksheets().getSheet(sheetno);
Cells cells=worksheet.getCells();
int num=cells.getMaxDataRow();
int num1=cells.getMaxDataColumn();
int numofsheet= workbook.getNumberOfSheets();
System.out.println(numofsheet);
for (int n1=0;n1<=num;n1++) {
Cell cell1=cells.getCell(n1,Colno);
if(cell1.getValue()!=null) {
String value =cell1.getValue().toString().toLowerCase();
if(value.equals(StartChar)) {
System.out.println( cell1.getValue());
int S= cell1.getRowIndex();
startpos=S+1;
System.out.println(startpos);
iii
iiielse{iii
iii
workbook.save("C:\Movies.xls",FileFormatType.EXCEL97TO2003);
return startpos;
iii catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
iii
iii
:-
CheckStartPosition(f1.xls, 0,"abc",2,0);
www.un.org/Depts/DGACM/index_spanish.htm 如何返回起点