[代码] [Java]代码 package k.finance;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import j ; xl.Sheet;
import jxl.Workbook;
import jxl.read.biff.BiffException;
import jxl.write.Label;
import jxl.write.WritableSheet;
import jxl.write.WritableWorkbook;
import jxl.write.WriteException;
import org.apache.commons.lang3.StringUtils;
public class GetContentFromXls {
/**
* @param args
*/
public static void main(String[] args) {
String file = "d://cuc.xls";
GetContentFromXls.get(file);
}
public static void get(String file){
Workbook workbook = null;
try {
workbook = Workbook.getWorkbook(new File(file));
Sheet sheet = workbook.getSheet(0);
//取得文件中一共有多少行
int totalRows = sheet.getRows();
System.out.println("总行数:" totalRows);
//数据处置结果list
List
阅读(679) | 评论(0) | 转发(0) |