China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-01 11:12
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Copy multiple folder files to one folder and rename the files View 6,977 Replies 0
Original Poster Posted 2020-03-11 22:43 ·  中国 湖南 常德 电信
新手上路
Credits 3
Posts 2
Joined 2008-01-16 11:46
18-year member
UID 108753
Gender Male
Status Offline
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 ]
Forum Jump: