import jxl.Workbook;
import jxl.Sheet;
import java.io.*;
import java.nio.Buffer;
/**
* Created by IntelliJ IDEA.
* User: sunny
* Date: 2006-9-27
* Time: 15:25:39
* To change this template use File | Settings | File Templates.
*/
public class a {
public static void main(String args[]) {
StringBuffer buffer = new StringBuffer();
try {
FileWriter out = new FileWriter("C:\\Documents and Settings\\sunny\\桌面\\kd.txt");
Workbook workbook = Workbook.getWorkbook(new File("C:\\Documents and Settings\\sunny\\桌面\\kd.xls"));
Sheet sheet = workbook.getSheet("kd");
int r = sheet.getRows();
int c = sheet.getColumns();
buffer.append("numleng=").append(r).append("&");
for (int i = 0; i < r; i++) {
for (int j = 0; j < c; j++) {
buffer = buffer.append("n").append(i).append("=").append(sheet.getCell(j, i).getContents()).append("&");
// System.out.print(sheet.getCell(j, i).getContents());
}
}
out.write(buffer.toString());
workbook.close();
} catch (Exception e) {
System.out.println(e);
}
{
}
}
}
posted on 2006-09-27 17:51
sunny 阅读(139)
评论(0) 编辑 收藏