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-01 10:17
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Please provide the specific batch processing code requirements and related details, such as the scope of files (specific folder path, file type, etc.), so that I can write the corresponding batch processing code to achieve adding a two-digit increasing digital sequence number in front of the file name. View 3,045 Replies 0
Original Poster Posted 2017-04-18 10:30 ·  中国 江苏 无锡 电信
新手上路
Credits 1
Posts 1
Joined 2017-04-14 15:50
9-year member
UID 182213
Gender Male
Status Offline
File names and extensions are not specific, possibly other file names and extensions
Original file name Desired effect
AGEM-12.TAP 01-AGEM-12.TAP
DRSG-4_3.TAP 02-DRSG-4_3.TAP
EM-12.TAP 03-EM-12.TAP

Detect the first 3 characters of file names in the folder
1. If there is no sequence number before all file names, then sort by modification time
2. If there is already a sequence number, do not add a sequence number again, and add a sequence number before the file name without a sequence number according to time (PS: if there is already 03-, then start from 04-)

There are quite a few requirements, please help, master!~~~~~~~
Forum Jump: