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-11 10:50
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Solved] How to batch rename files? View 1,074 Replies 5
Original Poster Posted 2009-02-14 01:50 ·  中国 福建 三明 电信
初级用户
★★
Credits 175
Posts 108
Joined 2008-05-19 01:24
18-year member
UID 119060
Gender Male
Status Offline
There are many MOV files in the same folder. How can I use A.TXT in that same folder to batch rename them? For example, change mysbdkr.mov to "The Eloquent Kong Rong.mov", change xdqyfx to "Xie Daoyun Cleverly Chanting Snow.mov". How should the code be written? Thanks in advance!

The contents of a.txt are:
AFTXZ Afanti Bathing
SZZG The Rope Grew Longer
WYBGSQQ Wen Yanbo Fetches a Ball by Pouring Water
SMGZGJR Sima Guang Smashes the Jar to Save the Child
GZQS The Pot Passes Away
LBKL Bitter Plums by the Roadside
XWCQJYLW Xu Wenchang Cleverly Wins a Gift
TJSM Tian Ji Horse Racing
DCPA Scarecrow Solves the Case
CCCX Cao Chong Weighs the Elephant
CZQBCS Cao Zhi Composes a Poem in Seven Steps
CNDLJ The Noisy Neighbor
MLDJL The Donkey Becomes Manager
ZMLQ Settling the Accounts
MSY Selling Tree Shade
TXDYW The Best Flavor Under Heaven
SSZH Disaster Brought on by Sacrificing Oneself
AFTZQML Afanti Cleverly Retrieves the Donkey

The separator in the middle is not a space, it's a TAB

[ Last edited by dddyjq1 on 2009-2-14 at 23:05 ]
Floor 2 Posted 2009-02-14 21:51 ·  中国 福建 三明 电信
初级用户
★★
Credits 175
Posts 108
Joined 2008-05-19 01:24
18-year member
UID 119060
Gender Male
Status Offline
Thank you, but the filenames didn't change
Floor 3 Posted 2009-02-14 22:11 ·  中国 福建 福州 连江县 电信
中级用户
★★
Credits 356
Posts 115
Joined 2004-07-27 00:00
22-year member
UID 29114
Gender Male
Status Offline
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
kennyfan +2 2009-02-15 18:52
Floor 4 Posted 2009-02-14 22:14 ·  中国 北京 鹏博士长城宽带
银牌会员
★★★★
[b]看你妹啊[/b]
Credits 1,488
Posts 1,357
Joined 2006-05-20 12:00
20-year member
UID 55770
Status Offline
I already feel sick replying to this kind of repetitive thread. It's nothing more than a FOR and a REN, and you can't even modify it yourself?
This is really discouraging.

有问题请发论坛或者自行搜索,再短消息问我的统统是SB
Floor 5 Posted 2009-02-14 22:16 ·  中国 福建 三明 电信
初级用户
★★
Credits 175
Posts 108
Joined 2008-05-19 01:24
18-year member
UID 119060
Gender Male
Status Offline
Exactly right, thanks, thanks
Floor 6 Posted 2009-02-14 22:26 ·  中国 重庆 电信
版主
★★★★★
Credits 9,023
Posts 5,017
Joined 2007-05-31 19:39
19-year member
UID 89899
Gender Male
Status Offline
If someone has helped you solve the problem, it is recommended that you do the following:

1. Edit the thread title and mark it with:

2. Give credits to the person who answered correctly as a way of showing thanks. Although everyone comes to the forum to learn rather than for credits, giving credits as a small token of appreciation can at least bring some comfort to the person who spent time and effort helping you selflessly.

3. If you wrote the code yourself based on someone else's hints, please post your own method and share it with everyone. Maybe others can point out deficiencies in your code, tell you how to improve execution efficiency, and so on. Only through discussion can you make faster progress.
Forum Jump: