I. Structure of the document
Second, the Code
ImportJava.io.File; Public classTest { Public Static voidMain (String args[]) {File F2=NewFile ("d://uml//heart failure 94 parts//Heart failure 94 Parts");//here Write the folder path of the replacement, note the use of double slashString[] Files1=f2.list (); String filename1= ""; File F1=NULL; intN=0; for(String file1:files1) {F1=NewFile (F2,FILE1);//Note that this must be written as file (Fl,file) if it is not possible to write file (file), be sure to complete the pathfilename1 =F1.getname (); //System.out.println (filename1);File fl=NewFile ("d://uml//heart failure 94 parts//Heart failure 94 parts//" +filename1);//here Write the folder path of the replacement, note the use of double slashString[] Files=fl.list (); File F=NULL; String filename=""; inti = 1; for(String file:files) {f=NewFile (Fl,file);//Note that this must be written as file (Fl,file) if it is not possible to write file (file), be sure to complete the pathFilename=F.getname (); //F.renameto (New File (Fl.getabsolutepath () + "//"+filename.replace ("---","-") ));//Replace substitution can be used over and over again, but you can also use regular expressions to replaceF.renameto (NewFile (Fl.getabsolutepath () + "//" + "0619" +filename1+ "-" +i+ ". jpg")); SYSTEM.OUT.PRINTLN (filename); I++; } } }}Third, before the amendment
Four, after the revision
Java fast, batch, lots of modified photos, picture filenames