Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[]args) {
- String[] args1={"0660", "0661", "0662", "0686", "0734", "0754", "0770","0762",
- "0766","0803", "0806", "0802", "0844", "0856", "0858", "0853", "0866",
- "0887", "0893","0918", "0921", "1051", "1037", "1040", "1053", "1058", "1107", "1111",
- "1113", "1143", "1160", "1218", "1256", "0646", "1331", "1338", "1340", "1373", "1380",
- "1388", "1428", "1444", "1446", "1448", "1455", "1458", "1495", "1505", "1543", "1554", "1575", "1579"};
- File source = new File("D:\\");
- File target = new File("B:\\pops/");
- String[] fileName = source.list();
- File[] files = source.listFiles();//corresponding 1-1
- for (int i=0 ; i<args1.length ; i++) {
- for (int j=0 ; j<fileName.length ; j++) {
- if (fileName[j].contains(args1[i])){//compare file names {
- File temp = new File(target.toPath()+fileName[i]);
- try {
- Files.copy(files[j].toPath(),temp.toPath() );
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- break;
- }
- }//endif
- }//end inner for
- }//end outer for
- System.out.print("job complete!");
- }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement