posts - 18,  comments - 1,  trackbacks - 0

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)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航:
 
<2006年9月>
272829303112
3456789
10111213141516
17181920212223
24252627282930
1234567

常用链接

留言簿(1)

随笔分类

随笔档案

相册

收藏夹

朋友

搜索

  •  

最新评论

评论排行榜