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-07-15 01:23
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » (Closed) A question about deleting files with the same size and type! View 3,850 Replies 25
Floor 16 Posted 2006-10-27 02:56 ·  中国 上海 浦东新区 电信
初级用户
Credits 30
Posts 14
Joined 2006-10-26 04:43
19-year member
UID 68307
Gender Male
Status Offline
Originally posted by he200377 at 2006-10-27 01:15 AM:
It's not easy to delete duplicate content files~



No, no, that's too complicated. Actually, it's like this:
There are many identical (same content) files in this folder.
Just when naming the files, so there will be *1*.txt, *2*.txt, etc.
Actually, just keep *1* and discard the others.
And temp1.txt and tmp1.txt are different (file size).
Only temp1.txt and temp2.txt are the same. That would be simpler, right?????
Thanks!
Floor 17 Posted 2006-10-27 03:01 ·  中国 上海 浦东新区 电信
初级用户
Credits 30
Posts 14
Joined 2006-10-26 04:43
19-year member
UID 68307
Gender Male
Status Offline
Originally posted by electronixtar at 2006-10-27 02:52 AM:
Remember a software called: Duplicate File Finder

Ah, ah, ah, there's another thing. I'll go find it. But still hope to help me solve this problem.
Thank you,大虾electronixtar for your great guidance.
Floor 18 Posted 2006-10-27 03:24 ·  中国 四川 南充 电信
超级版主
★★★★
我爱DOS
Credits 5,310
Posts 2,044
Joined 2005-09-26 12:00
20-year member
UID 42843
Gender Male
From 四川南充
Status Offline
@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
for /f "tokens=*" %%a in ('dir/a-d/b/oe') do set/a c+=1&set a!c!=%%a&set b!c!=%%~za&set c!c!=%%~xa
for /l %%a in (1,1,%c%) do set/a d=%%a+1&for /l %%b in (!d!,1,%c%) do if not !b%%a!.==. call :1 %%a %%b
goto :eof
:1
if !b%1!==!b%2! if !c%1!==!c%2! set b%2=&del "!a%2!"
goto :eof
Floor 19 Posted 2006-10-27 03:28 ·  中国 四川 南充 电信
超级版主
★★★★
我爱DOS
Credits 5,310
Posts 2,044
Joined 2005-09-26 12:00
20-year member
UID 42843
Gender Male
From 四川南充
Status Offline
After repeated trials, the above code should be able to solve the problem of the original poster. But is this thread posted in the wrong place?
Floor 20 Posted 2006-10-27 03:52 ·  中国 上海 浦东新区 电信
初级用户
Credits 30
Posts 14
Joined 2006-10-26 04:43
19-year member
UID 68307
Gender Male
Status Offline
Originally posted by qwe1234567 at 2006-10-27 03:24 AM:
@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
for /f "tokens=*" %%a in ('dir/a-d/b/oe') do set/a c+=1&set a!c!=%%a&set b!c!=%%~za&set c!c!=%%~xa
for /l %%a in (1,1,%c%) do set/ ...


Hahaha, thanks to the perfect codes from moderator qwe1234567. It was completely successful!!!

Here, I also want to thank electronixtar. My expression ability made him spend a lot of brain cells. But I also learned a lot of .bat knowledge. I will continue to ask electronixtar, the expert, in the future, but it will waste a lot of electronixtar's brain cells again -_-。^_^

I also want to thank he200377,大虾 lxmxn and others for their attention, otherwise my post would have sunk to the bottom of the sea!!!

!!!!! These words are so familiar!!! It seems like lines from *****TV.

^_^ Thanks to everyone. What the moderator qwe1234567 said is right. I carefully went out to check the house number. . . Depressed, I entered the wrong door! But I'll just settle here even if it's a wrong entry. Moreover, I still have some不懂的 places in the above code to ask.
Floor 21 Posted 2006-10-27 03:56 ·  中国 四川 南充 电信
超级版主
★★★★
我爱DOS
Credits 5,310
Posts 2,044
Joined 2005-09-26 12:00
20-year member
UID 42843
Gender Male
From 四川南充
Status Offline
Floor 22 Posted 2006-10-27 04:03 ·  中国 上海 浦东新区 电信
初级用户
Credits 30
Posts 14
Joined 2006-10-26 04:43
19-year member
UID 68307
Gender Male
Status Offline
Originally posted by qwe1234567 at 2006-10-27 03:56 AM:
I'll still transfer it to {DOS Batch & Script Technology (Batch Processing Room)}

Moderator qwe1234567, what can I say about you!!
You're just a good person. ^_^
Floor 23 Posted 2006-10-27 04:12 ·  中国 甘肃 甘南藏族自治州 合作市 电信
金牌会员
★★★★
Credits 4,103
Posts 1,744
Joined 2006-01-20 13:00
20-year member
UID 49241
Gender Male
From 甘肃.临泽
Status Offline
The title of the article is seriously wrong. How can it be said to be duplicate files??? It leads us to an erroneous understanding
Floor 24 Posted 2006-10-27 04:20 ·  中国 上海 浦东新区 电信
初级用户
Credits 30
Posts 14
Joined 2006-10-26 04:43
19-year member
UID 68307
Gender Male
Status Offline
Originally posted by he200377 at 2006-10-27 04:12 AM:
The title of the article is seriously wrong. How can it be said to be a duplicate file??? It leads us to wrong understanding


^_^, sorry, I just said I am not good at Chinese.
Otherwise,大虾electronixtar wouldn't have wasted so many brain cells. Hahaha.
I also hope that there are experts who can add QQ or MSN and so on. In this way, if I don't understand, I can also explain slowly. But.... I have tried many times and no one adds me. 5555555555555555555~~~~~.
I have to ask repeatedly patiently, and I also hope that all the experts can understand!
Floor 25 Posted 2006-10-27 04:39 ·  中国 四川 南充 电信
超级版主
★★★★
我爱DOS
Credits 5,310
Posts 2,044
Joined 2005-09-26 12:00
20-year member
UID 42843
Gender Male
From 四川南充
Status Offline
Because the title does not match the content, please the poster modify the title to: (Closed) A question about deleting files with the same size and type! Otherwise, the poster may lose points! The method is to click "Edit" under the topic to edit!
Floor 26 Posted 2006-10-27 05:23 ·  中国 上海 浦东新区 电信
初级用户
Credits 30
Posts 14
Joined 2006-10-26 04:43
19-year member
UID 68307
Gender Male
Status Offline
Originally posted by qwe1234567 at 2006-10-27 04:39 AM:
Because the title does not match the content, please the thread starter to modify the title to:
(Closed) A question about deleting files with the same size and type!
Otherwise, the thread starter may be deducted points! The method is to click the "reply" under the topic..

Received, will fix it immediately! Haha
Forum Jump: