『楼 主』:
将多个文件夹文件复制到一个文件夹并重命名文件
使用 LLM 解释/回答一下
想将多个文件夹里的文件,复制到一个文件夹里,比如有文件夹1、2、3、到100个;比如文件夹1里有文件A.JPG B.JPG ;文件夹2里面有A.JPG C.JPG ; 文件夹里有A.JPG B.JPG C.JPG; 这样有较多的同名文件,要求全部都复制到一个新文件夹里,因为A.JPG有三个重复的,要求在新文件夹里只保留一个并重命名为A=3.JPG ,B.JPG有两个重复的就命名为B=2.JPG, C也是两个重复重名为C=2.JPG,这样在新文件夹里就是这三个:A=3.JPG
B=2.JPG
C=2.JPG
求高手写一段这样的代码,谢谢!
Last edited by hlzer on 2020-3-11 at 22:58 ]
Want to copy files from multiple folders into one folder, for example, there are folders 1, 2, 3, ..., 100; for example, folder 1 has files A.JPG B.JPG; folder 2 has A.JPG C.JPG; folder 3 has A.JPG B.JPG C.JPG; there are many duplicate files like this, and it is required to copy all of them into a new folder. Because there are three duplicates of A.JPG, it is required to keep only one in the new folder and rename it to A=3.JPG, B.JPG has two duplicates so rename it to B=2.JPG, C also has two duplicates rename it to C=2.JPG, so in the new folder there are these three: A=3.JPG
B=2.JPG
C=2.JPG
Please ask experts to write a code like this, thank you!
Last edited by hlzer on 2020-3-11 at 22:58 ]
|