中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-11 16:39
47,811 topics / 349,897 posts / today 0 new / 48,256 members
DOS批处理 & 脚本技术(批处理室) » Want to rename MP3 filenames
Printable Version  790 / 5
Floor1 dosz Posted 2009-03-14 09:29
中级用户 Posts 188 Credits 396 From 上海
I have some files named
mm-66.mp3
mm-67.mp3
mm-68.mp3
I want to change them to
mm-66.mp3
mm-67.mp3
mm-68.mp3

I know this is just how it displays. But I don't know why it displays as " mm-66 3 " " mm-67 3 " " mm-68 3 "



ren ?


[ Last edited by dosz on 2009-3-14 at 09:35 ]
Floor2 netbenton Posted 2009-03-14 09:38
银牌会员 Posts 752 Credits 1,916 From 广西
"delims=" treats single characters as delimiters, not a string.
What you want can be done with one command, no need to make it so complicated:
ren *.mp3 ?????.*
Floor3 dosz Posted 2009-03-15 03:29
中级用户 Posts 188 Credits 396 From 上海
Originally posted by netbenton at 2009-3-14 09:38:
"delims=" treats single characters as delimiters, not a string.
What you want can be done with one command, no need to make it so complicated:
ren *.mp3 ?????.*


"delims="delimiter"" can be a whole character set, please look at the following example:

Attachments
未命名.PNG (9.99 KiB)
Floor4 dosz Posted 2009-03-15 03:41
中级用户 Posts 188 Credits 396 From 上海
re: htnetbenton
Take a look here http://cn-dos.net/forum/viewthread.php?tid=46633
Floor5 netbenton Posted 2009-03-15 05:23
银牌会员 Posts 752 Credits 1,916 From 广西
It supports a character set, but not a string. Look carefully: the later "mp3" also loses the "mp",
and if the string you want to extract contains characters from that character set, it will also get split.

================================
Thanks, now I understand what's going on with that signature.
Floor6 313885174 Posted 2009-03-16 00:38
中级用户 Posts 100 Credits 206
for /r %%i in (*.mp3) do (
for /l %%j in (1,1,100) do ren %%i mm-%%~j.mp3
)
Like this?

[ Last edited by 313885174 on 2009-3-16 at 00:39 ]
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023