folder contents and file names are shown in the figure. Under each R folder, there is a pile of .jpg files starting with C
R
.
modify directly from R1 to R10 and then return to R2, the picture is the same problem, do not know how to change, hope boss advice!
attach your own bat file
@echo off & setlocal EnableDelayedExpansion
set /a numjpg=0
set /a numfile=0
set ext=.jpg
echo
for /r . %%i in (*.jpg) do (
if %%~ni equ C0 (set /a numjpg=0)
echo %%i !numjpg!%ext% >>file.txt
ren %%i !numjpg!%ext%
set /a numjpg += 1
)
echo
for /f "delims=" %%i in ("dir /a:d /b") do (
if %%~ni equ R0 (set /a numfile=0)
echo %%i !numfile! >>file.txt
ren %%i !numfile!
set /a numfile +=1
)
pause>nul