简体   繁体   中英

I have 30 docx file with the different name in that I want to to replace the some letters without affecting the inside content how do I that?

Like I am having Req_250: a Req_6497: b Sysreq_234 a Here I want to put-> "COLON" instead of ":" and "_" instead of " " How to that please give idea

You can used File renameTo() to rename your file

such as

File file=new File("../path/Req_250: a Req_6497: b Sysreq_234.docx");
boolean renameResult = file.renameTo(new File(file.getParent()+"/"+file.getName().replace(":", "COLON").replace(" ", "_")));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM