Java fast, batch, lots of modified photos, picture filenames

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.