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-06-23 00:13
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Solved帖] About the renaming algorithm of ACDSee View 2,369 Replies 21
Floor 16 Posted 2008-07-30 22:51 ·  中国 浙江 杭州 电信
初级用户
★★
Credits 192
Posts 72
Joined 2005-07-31 21:10
20-year member
UID 41234
Status Offline
There's no way, renaming is sensitive to efficiency, especially when batch renaming more than 1000 files, saving a little is a little -_-||
Floor 17 Posted 2008-07-30 22:59 ·  中国 湖南 株洲 电信
金牌会员
★★★★
永远的学习者
Credits 3,105
Posts 1,276
Joined 2008-03-08 13:00
18-year member
UID 112398
Gender Male
Status Offline
Originally posted by obsolete at 2008-7-30 22:51:
No way, renaming is sensitive to efficiency, especially when batch renaming more than 1000 files, every bit saved counts -_-||

I don't know what efficiency the LZ is referring to. What about 1000, 10000, 100000? Just write and use it on the fly...
Passion for learning batch processing is important, but the direction of effort should not deviate.
批处理之家新域名:www.bathome.net
Floor 18 Posted 2008-07-30 23:10 ·  中国 浙江 杭州 电信
初级用户
★★
Credits 192
Posts 72
Joined 2005-07-31 21:10
20-year member
UID 41234
Status Offline
Well, I'm just starting to be interested in things written with batch processing. Usually, I don't have a clue and don't know what to write. I just want to figure out whatever I get my hands on. Actually, I don't plan to be all - round in batch processing. I just want to solve some daily problems. I think this is a very good topic.
Floor 19 Posted 2008-07-30 23:13 ·  中国 浙江 杭州 电信
初级用户
★★
Credits 192
Posts 72
Joined 2005-07-31 21:10
20-year member
UID 41234
Status Offline
This attempt is not completely fruitless:
1. set has relatively high efficiency
2. call and set waste time, try to avoid them
3. Zero-padding algorithm for numbers

So I think, considering efficiency more, it should also be helpful for learning batch processing.
Floor 20 Posted 2008-07-31 22:07 ·  中国 浙江 杭州 电信
初级用户
★★
Credits 192
Posts 72
Joined 2005-07-31 21:10
20-year member
UID 41234
Status Offline
Well, I still continue to persevere, with the spirit of sharing -_-||
The efficiency issues of call and set were repeatedly mentioned earlier. Today, I tried replacing call and set with for loops and found that the efficiency improved a lot. By using nested for loops, I believe that in occasions where efficiency has a relatively large impact, call and set can basically be abandoned.


@echo off
setlocal enabledelayedexpansion

set template=?a??b???c????d?????e??????f???????g????????h?????????i??????????j???????????k????????????l?????????????m??????????????n???????????????o????????????????p?????????????????q??????????????????r???????????????????s????????????????????t?????????????????????u??????????????????????

set template=!template:?=:?!
set template=!template:?:=/!
set template=!template::=!

for /l %%a in (1,1,1001) do (
set file=%template%
set temp=%%a:::::::::%%a
for %%b in (!temp:~10!) do set file=!file:?=%%b!
for /l %%i in (1,1,9) do set file=!file:/:=!
set file=!file:/=0!
set file=!file::=!
echo !file!
echo.
)

pause


[ Last edited by obsolete on 2008-7-31 at 11:15 PM ]
Floor 21 Posted 2008-07-31 22:16 ·  中国 广东 广州 电信
银牌会员
★★★★
SuperCleaner
Credits 2,362
Posts 1,133
Joined 2008-02-02 21:36
18-year member
UID 110072
Gender Male
Status Offline
Ah~ Ali braised duck~~
only you ~ It shouldn't be like this, really. If the time we spend writing code exceeds the time we spend using the mouse, and there are always bugs, it will be a thankless task

This spirit we all need, but it should be spent on better innovative aspects



Reply to post 22, uh... I don't know what to say...
But I have an experience. I can't think of anything all day facing the computer
But when I was in school, I was particularly bored, and I had a lot of inspiration... I don't know how it is
I think, you need to relax

[ Last edited by 523066680 on 2008-8-1 at 10:47 AM ]
Floor 22 Posted 2008-07-31 22:25 ·  中国 浙江 杭州 电信
初级用户
★★
Credits 192
Posts 72
Joined 2005-07-31 21:10
20-year member
UID 41234
Status Offline
Originally posted by 523066680 at 2008-7-31 22:16:
Ah~ Ali duck~~
only you ~ It shouldn't be like this, really. If the time we spend writing code exceeds the time we spend using the mouse, and there are always bugs, it will be a very thankless task...


Well, thank you for the advice. I didn't expect that the shortcomings were exposed in such a short time. Actually, it's the same with my work. The things involved are too few, and I feel frustrated compared with others...
Forum Jump: