<SPAN style="FONT-SIZE: small">public class ExcelReader {
private static File [] getFiles(String path){
File file = new File(path);
// get the folder list
File[] array = file.listFiles();
return array;
}
public static void main(String[] args) throws IOException {
// TODO code application logic here
File[] files=getFiles("D://data//");
for(int i=0;i<files.length;i++){
String filePath=files[i].getPath();
String fileName=files[i].getName();
String newFileName=fileName.substring(0, fileName.indexOf('.'));
String s="";
try{
ExcelReader er=new ExcelReader(filePath);
String line=er.readLine();
while(line != null){
s=s+line+"/r/n";
line=er.readLine();
}
er.close();
}catch(Exception e){
e.printStackTrace();
}
//System.out.println(s);
Java实现将Excel批量转换成txt
最新推荐文章于 2024-01-03 16:45:09 发布