package com.itFan.Excel;
import java.io.File;
public class ccc {
public static void main(String[] args) {
File file = new File("D:\\百死求生\\商品上传");
File[] files = file.listFiles();
for (File file1 : files) {
String name = file1.getName();
System.out.println(name);
if (name.indexOf("-阿里巴巴") !=-1){
System.out.println("name中包含-阿里巴巴");
String replaceName = name.replace("-阿里巴巴", "");
boolean b = file1.renameTo(new File("D:\\百死求生\\商品上传\\" + replaceName));
System.out.println("是否修改成功++=="+b);
}
}
}
}
批量修改文件夹名
最新推荐文章于 2023-10-30 22:12:13 发布