|
laineve
新手上路

积分 18
发帖 18
注册 2010-6-11
状态 离线
|
『楼 主』:
这样批量改名能使文件名尾成递增序列?
使用 LLM 解释/回答一下
a.txt ,b.txt,c.txt
我想吧 他变成a1.txt,b2.txt,c3.txt
a.txt ,b.txt,c.txt
I want to change them into a1.txt, b2.txt, c3.txt
|
|
2010-8-5 22:41 |
|
|
wangyang331407
初级用户
 
积分 28
发帖 28
注册 2010-7-28
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
@echo off
setlocal enabledelayedexpansion
set num=0
for /f %%i in ('dir /a-d /b ?.txt') do (
set /a num+=1
echo !num!
ren %%i ?!num!.txt
)
pause & exit
@echo off
setlocal enabledelayedexpansion
set num=0
for /f %%i in ('dir /a-d /b ?.txt') do (
set /a num+=1
echo !num!
ren %%i ?!num!.txt
)
pause & exit
|
|
2010-8-7 16:26 |
|
|
laineve
新手上路

积分 18
发帖 18
注册 2010-6-11
状态 离线
|
|
2010-8-7 18:17 |
|
|
laineve
新手上路

积分 18
发帖 18
注册 2010-6-11
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
貌似不能活用。。。。换个名字就不ok了、。。。
It seems that it can't be flexibly used... If you change the name, it won't be okay...
|
|
2010-8-7 18:28 |
|
|
churui007
新手上路

积分 12
发帖 12
注册 2010-8-3
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
关键是你没写出排列规则。
The key is that you didn't write out the arrangement rules.
|
|
2010-8-7 18:37 |
|
|
wangyang331407
初级用户
 
积分 28
发帖 28
注册 2010-7-28
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
我也是菜鸟一只。你有没有研究出更好的的方法啊?分享一下呗。
I'm also just a beginner. Have you figured out a better method? Share it with us, please.
|
|
2010-8-7 20:19 |
|
|
jike106397
新手上路

积分 9
发帖 3
注册 2010-5-31
状态 离线
|
『第 7 楼』:
好好
使用 LLM 解释/回答一下
好好看下,这个地方真大!!
Take a good look, this place is really big!!
|
|
2010-8-8 00:54 |
|
|
laineve
新手上路

积分 18
发帖 18
注册 2010-6-11
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
规则?不是吧,我感觉规则很明显啊。。。
我是想把几个文件,文件名任意。。。只是分别给这几个文件加入1~n在最后。。。
不过现在感觉不妥。。。我是想要让他们正常排序,最好还是放在之前
比如说吧:原来有n个文件(每个名字都不同,但是是同类型的,为了方便这些文件名都用*代替吧)
我现在想把这些文件前面加上序列号:1*.txt,2*,txt....N*.txt
Rules? No way, I feel the rules are very obvious...
I want to add 1 to n at the end of several files, with any file names...
But now I feel it's not appropriate... I want them to be sorted normally, preferably placed before
For example: Originally there are n files (each name is different, but of the same type, for the convenience of these file names are all replaced with *),
Now I want to add serial numbers in front of these files: 1*.txt, 2*.txt....N*.txt
|
|
2010-8-8 09:48 |
|
|
laineve
新手上路

积分 18
发帖 18
注册 2010-6-11
状态 离线
|
『第 9 楼』:
使用 LLM 解释/回答一下
以上*为任意正常文件名
The above * is any normal file name
|
|
2010-8-8 09:50 |
|
|
churui007
新手上路

积分 12
发帖 12
注册 2010-8-3
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
你这话说的好像家里有6个孩子,当爹不管他们年龄随便给他们排长幼似的。
我所说的规则,比如根据文件大小排序,或者根据文件名排序,或者修改时间等等。
What you said is like having 6 children at home and the father randomly arranging their order of seniority regardless of their ages.
The rules I mentioned, such as sorting by file size, or by file name, or by modification time, etc.
|
|
2010-8-8 09:57 |
|
|
laineve
新手上路

积分 18
发帖 18
注册 2010-6-11
状态 离线
|
『第 11 楼』:
使用 LLM 解释/回答一下
呵呵,我说的就是那个意思,要是你有能按照修改时间或者文件大小顺序给他们依次在前面增加序号的方法,也欢迎说下
Hehe, that's what I meant. If you have a way to add serial numbers in front of them in order according to the modification time or file size, you are also welcome to share it.
|
|
2010-8-8 13:53 |
|
|
churui007
新手上路

积分 12
发帖 12
注册 2010-8-3
状态 离线
|
『第 12 楼』:
使用 LLM 解释/回答一下
dir 文件夹
整理出文件名
findstr /i txt
套用2楼代码完成
具体的自己写去
dir 文件夹
Extract file names
findstr /i txt
Apply the code from floor 2 to complete
Do it yourself specifically
|
|
2010-8-8 19:58 |
|
|
laineve
新手上路

积分 18
发帖 18
注册 2010-6-11
状态 离线
|
『第 13 楼』:
使用 LLM 解释/回答一下
会写我也不会问看撒。。。。
I can't write or won't ask, let's see...
(注:原句中有比较随意的口语化表达,按照要求尽量直译,同时保持原本的表述风格)
|
|
2010-8-8 20:10 |
|
|
laineve
新手上路

积分 18
发帖 18
注册 2010-6-11
状态 离线
|
『第 14 楼』:
使用 LLM 解释/回答一下
没动静。。。看来12楼是个眼高手低的家伙,一开始就冷嘲热讽,现在看来果然不会
No response... It seems that the person on the 12th floor is someone who talks big but is short on action. He started with sarcasm, and now it turns out he really can't.
|
|
2010-8-9 00:07 |
|
|
slore
铂金会员
      
积分 5212
发帖 2478
注册 2007-2-8
状态 离线
|
『第 15 楼』:
使用 LLM 解释/回答一下
光等着别人送饭吃的话总有一天会饿死……
自己先看会2楼的代码交换下位置就好了。。。
@echo off
setlocal enabledelayedexpansion
set num=0
for /f "delims=" %%i in ('dir /a-d /b *.txt') do (
set /a num+=1
echo %%~ni
ren "%%i" "!num!%%~ni.txt"
)
pause & exit
If you just wait for others to bring you food, you will starve to death one day...
Just look at the code on floor 2 and exchange the positions by yourself...
@echo off
setlocal enabledelayedexpansion
set num=0
for /f "delims=" %%i in ('dir /a-d /b *.txt') do (
set /a num+=1
echo %%~ni
ren "%%i" "!num!%%~ni.txt"
)
pause & exit
|

S smile 微笑,L love 爱,O optimism 乐观,R relax 放松,E enthusiasm 热情...Slore |
|
2010-8-9 08:32 |
|