- 博客(0)
- 资源 (3)
空空如也
POI兼容2003 和 2007
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory;
Workbook workbook = WorkbookFactory.create(new FileInputStream(new File(文件路径)));
jar包包括:
dom4j-1.6.1.jar
poi-3.6-20091214.jar
poi-ooxml-3.6-20091214.jar
poi-ooxml-schemas-3.6-20091214.jar
xbean.jar
2012-09-12
bath标签代码
package com.csv.test;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
public class CvsInputTest {
public static void main(String[] args) {
try {
//FileInputStream fis = new FileInputStream("D:/course/JavaProjects/JavaSE/chapter08/temp01");//绝对路径
InputStream inputStream = new FileInputStream("F:/2012.08.07卡惠数据/buz_2012-08-07 - 副本.csv");//绝对路径
InputStreamReader inputStramReader = new InputStreamReader(inputStream);
BufferedReader reader = new BufferedReader(inputStramReader);
try {
int k =0;
String tempString = "";
while((tempString = reader.readLine())!=null){
//System.out.println(tempString);
String[] str ;
str=tempString.split(",");
tempString.split(",");
//for(int i = 0;i<str.length;i++){
//System.out.println(str[i]);
if(str.length!=22){
System.out.println(str.length);
k++;
}
}
System.out.println(k);
} catch (Exception e) {
// TODO: handle exception
}
} catch (Exception e) {
// TODO: handle exception
}
}
}
2012-08-08
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人