|
WinXYhappy
初级用户
 
积分 30
发帖 14
注册 2006-10-26
状态 离线
|
『楼 主』:
(已结)一个关于删除大小和类型一样的文件的问题!
使用 LLM 解释/回答一下
例如:如果一个文件夹下有如下文件(文件夹名知道asd,文件夹里面的文件很多,无法手动列出):
驱动器 D 中的卷是 WINDOWS
卷的序列号是 E42C-4D75
D:\asd\asd 的目录
2006-10-24 17:47 <DIR> ..
2006-10-24 17:47 <DIR> .
2006-10-20 11:47 1,226 tftp.txt
2006-10-16 15:51 2,306 ftp1 server.txt
2006-10-16 15:51 2,306 ftp1.txt
2006-10-16 15:51 2,306 ftp2.txt
2006-10-16 15:51 2,306 ftp3.txt
2006-10-16 15:51 2,306 ftp1.rar
2006-10-16 15:51 2,306 ftp1.log
2006-10-16 15:51 2,306 ftp2 server.txt
2006-10-20 14:30 10,752 ftp1.doc
9 个文件 28,120 字节
2 个目录 12,679,954,432 可用字节
如何将大小一样并且文件类型一样的文件删除???
(也就是说要删除:ftp2.txt,ftp3.txt,ftp2 server.txt这三个文件,)
Last edited by WinXYhappy on 2006-10-27 at 05:23 AM ]
For example: If there are the following files under a folder (the folder name is known as asd, and there are many files in the folder, which cannot be listed manually):
Volume in drive D is WINDOWS
Volume Serial Number is E42C-4D75
Directory of D:\asd\asd
2006-10-24 17:47 <DIR> ..
2006-10-24 17:47 <DIR> .
2006-10-20 11:47 1,226 tftp.txt
2006-10-16 15:51 2,306 ftp1 server.txt
2006-10-16 15:51 2,306 ftp1.txt
2006-10-16 15:51 2,306 ftp2.txt
2006-10-16 15:51 2,306 ftp3.txt
2006-10-16 15:51 2,306 ftp1.rar
2006-10-16 15:51 2,306 ftp1.log
2006-10-16 15:51 2,306 ftp2 server.txt
2006-10-20 14:30 10,752 ftp1.doc
9 File(s) 28,120 bytes
2 Dir(s) 12,679,954,432 bytes free
How to delete files with the same size and the same file type???
(That is to say, the three files ftp2.txt, ftp3.txt, and ftp2 server.txt need to be deleted,)
Last edited by WinXYhappy on 2006-10-27 at 05:23 AM ]
|
|
2006-10-26 05:25 |
|
|
vkill
金牌会员
     
积分 4103
发帖 1744
注册 2006-1-20 来自 甘肃.临泽
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
记得有个小东西直接可以删除的,est 发过
I remember there was a small thing that could be directly deleted, est posted about it
|
|
2006-10-26 07:58 |
|
|
lxmxn
版主
       
积分 11386
发帖 4938
注册 2006-7-23
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
楼主是要删除全部大小和类型一样的文件,还是保留一个,其它的都删除呢?
Are you going to delete all files with the same size and type, or keep one and delete the others?
|
|
2006-10-26 09:05 |
|
|
electronixtar
铂金会员
      
积分 7493
发帖 2672
注册 2005-9-2
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
for /f "delims=" %a in ('dir /a ^| find "2,306"') do @echo %a
确认无误后把 echo %a 改成 del %a
```
for /f "delims=" %a in ('dir /a ^| find "2,306"') do @del %a
```
|

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>" |
|
2006-10-26 10:13 |
|
|
WinXYhappy
初级用户
 
积分 30
发帖 14
注册 2006-10-26
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
Originally posted by lxmxn at 2006-10-26 09:05 AM:
楼主是要删除全部大小和类型一样的文件,还是保留一个,其它的都删除呢?
保留一个。删除其它的大小跟这个一样“并且”类型“也一样的的文件。
Originally posted by lxmxn at 2006-10-26 09:05 AM:
The owner wants to delete all files with the same size and type, or keep one and delete the others?
Keep one. Delete other files that have the same size "and" also the same type as this one.
|
|
2006-10-26 20:16 |
|
|
不得不爱
超级版主
         我爱DOS
积分 5310
发帖 2044
注册 2005-9-26 来自 四川南充
状态 离线
|
|
2006-10-26 20:29 |
|
|
WinXYhappy
初级用户
 
积分 30
发帖 14
注册 2006-10-26
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
Originally posted by electronixtar at 2006-10-26 10:13 AM:
for /f "delims=" %a in ('dir /a ^| find "2,306"') do @echo %a
确认无误后把 echo %a 改成 del %a
我的意思是:首先,我们不知道文件夹里有多少个文件(因为太多了没法手工列出来),然后不知道文件的大小。只知道文件夹的名和文件夹路径。上面列出来的是举的一个简单的例子。实际上有很多文件(主要是.doc,.xls文件太多了没法在这列出来)并且有很多名字类似,大小一样的文件其实是一样的。所以要删除之节省空间。
希望electronixtar能再帮忙改进一下。顺便问问批处理能否实现模糊匹配例如:将(temp1.doc,temp2.doc,temp3.doc,temp4.doc~~)删除temp2~~.doc保留temp1.doc。
注:temp只是代指要处理的文件。
Originally posted by electronixtar at 2006-10-26 10:13 AM:
for /f "delims=" %a in ('dir /a ^| find "2,306"') do @echo %a
After confirming it is correct, change echo %a to del %a
What I mean is: First, we don't know how many files are in the folder (because there are too many to list manually), and we don't know the size of the files. We only know the name and path of the folder. The above is a simple example. Actually, there are many files (mainly.doc,.xls files, too many to list here), and there are many files with similar names and the same size that are actually the same. So we need to delete them to save space.
Hope electronixtar can help improve it again. By the way, can batch processing achieve fuzzy matching, for example: delete (temp1.doc, temp2.doc, temp3.doc, temp4.doc~~) and keep temp1.doc by keeping temp2~~.doc.
Note: temp is just a placeholder for the files to be processed.
|
|
2006-10-26 20:39 |
|
|
electronixtar
铂金会员
      
积分 7493
发帖 2672
注册 2005-9-2
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
很简单,把 temp1.doc 复制出来,把文件夹删除了;
It's very simple, copy out temp1.doc and delete the folder.
|

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>" |
|
2006-10-26 20:58 |
|
|
WinXYhappy
初级用户
 
积分 30
发帖 14
注册 2006-10-26
状态 离线
|
『第 9 楼』:
使用 LLM 解释/回答一下
Originally posted by electronixtar at 2006-10-26 08:58 PM:
很简单,把 temp1.doc 复制出来,把文件夹删除了;
郁郁郁郁郁郁郁郁郁郁闷了!
不过我想做学问就是这样吧!
我的意思是这个文件夹我知道其命,但是文件夹里的文件明我不知道(所以上面的temp只是代指,,,,,代指。不是实际的)。因为文件太多了,我没发一一列出来。
例如例如例如例如:
有temp1.doc,temp2.doc,temp3.doc~~
tmp1.xls,tmp2.xls,tmp3.xls~~
study1.txt,study2.txt~~
***1.gif,***2.gif~~~~
所以这个dir的功能也要在del.bat里在实现,并且还要找到(***)然后执行删除重复文件的功能。不知electronixtar明白了没。哎呀我表达能力呀,所以。。。。。。。。。。哈哈哈哈哈哈。electronixtar要认真揣摩一下我的意思了。谢谢了。
Originally posted by electronixtar at 2006-10-26 08:58 PM:
It's very simple. Copy out temp1.doc and delete the folder;
So depressed!
But I guess that's how scholarship is!
What I mean is I know the name of this folder, but I don't know the names of the files in the folder (so the above temp is just a placeholder,...... a placeholder. Not actual). Because there are too many files, I can't list them one by one.
For example for example for example for example:
There are temp1.doc, temp2.doc, temp3.doc~~
tmp1.xls, tmp2.xls, tmp3.xls~~
study1.txt, study2.txt~~
***1.gif, ***2.gif~~~~
So the function of dir also needs to be implemented in del.bat, and also find (***) then perform the function of deleting duplicate files. I don't know if electronixtar understands. Oh my expression ability, so...... hahaha. electronixtar needs to carefully figure out my meaning. Thanks.
|
|
2006-10-26 23:56 |
|
|
electronixtar
铂金会员
      
积分 7493
发帖 2672
注册 2005-9-2
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
如果该操作只有一次的话,可以通过Windows的搜索功能来完成,嘿嘿~
If this operation is only done once, you can complete it through Windows' search function, heh heh~
|

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>" |
|
2006-10-27 00:09 |
|
|
electronixtar
铂金会员
      
积分 7493
发帖 2672
注册 2005-9-2
状态 离线
|
『第 11 楼』:
使用 LLM 解释/回答一下
哈哈哈哈,我找了一上午关于删除的都看了。好像不太合乎我的条件。
那是he200377看错了,我当时看了楼主的题目也认为是真正的顽固重名文件,结果是重复文件呢。呵呵
Hahaha, I spent the whole morning looking at everything related to deletion. It doesn't seem to fit my conditions.
That was he200377 who misread it. I also thought it was a really stubborn duplicate file when I saw the title of the original poster, but it turned out to be a duplicate file. Hehe
|

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>" |
|
2006-10-27 00:11 |
|
|
不得不爱
超级版主
         我爱DOS
积分 5310
发帖 2044
注册 2005-9-26 来自 四川南充
状态 离线
|
|
2006-10-27 01:10 |
|
|
vkill
金牌会员
     
积分 4103
发帖 1744
注册 2006-1-20 来自 甘肃.临泽
状态 离线
|
『第 13 楼』:
使用 LLM 解释/回答一下
要是把文件内容重复的删除那不好办~
If you want to delete duplicate file contents, it's not easy.
|
|
2006-10-27 01:15 |
|
|
WinXYhappy
初级用户
 
积分 30
发帖 14
注册 2006-10-26
状态 离线
|
『第 14 楼』:
使用 LLM 解释/回答一下
不是的,我要重复执行很多次。太多了,所以我想写个批处理来完成。
自己本事又不高所以,来求助各路大侠了。
哈哈哈
No, I need to repeat it many times. There are too many, so I want to write a batch script to do it. I'm not very capable myself, so I'm here to ask for help from all the experts. Hahaha
|
|
2006-10-27 02:46 |
|
|
electronixtar
铂金会员
      
积分 7493
发帖 2672
注册 2005-9-2
状态 离线
|
『第 15 楼』:
使用 LLM 解释/回答一下
记得一个软件叫:重复文件查找器
Remember a software called: Duplicate File Finder
|

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>" |
|
2006-10-27 02:52 |
|