package file;
import java.io.File;
import java.nio.channels.FileChannel;
import java.io.*;
public class pro {
String[] link=new String[6000];
int number;
public static void main(String[] args) {
pro r=new pro();
}
pro(){
File f=new File("data");
String[] fx=f.list();
int tr;
for(tr=1;tr<36;tr++){
String strx="("+tr+")";
int s,sx;
sx=0;
for(s=0;s<fx.length;s++){
if(fx[s].indexOf(strx)>-1)sx=sx+1;
if(fx[s].indexOf(strx)>-1)link[sx]=fx[s];
}
number=sx;
for(s=1;s<number+1;s++){
try {
copy("data/"+link[s],tr+"/"+s+".xls");
} catch (IOException e) {e.printStackTrace();}
}
}
}
public static void copy(String srcPath, String destPath) throws IOException {
FileChannel srcChannel = new
FileInputStream(srcPath).getChannel();
FileChannel destChannel = new
FileOutputStream(destPath).getChannel();
try {
srcChannel.transferTo(0, srcChannel.size(), destChannel);
} finally {
srcChannel.close();
destChannel.close();
}
}
}
最終更新:2016年06月13日 23:07