image - Batch Script creating mutliple text files with incrementing numbers inside -


i'm trying right script creates multiple text files list of image names need each of them have incremented number in contents. far i've come this

setlocal enabledelayedexpansion  set /a i=0  /f %%f in ( 'dir /b /a-d %1"*.jpg"' ) (     set /a i=i+1     @rem echo %%f !i! )  %%a in (*.jpg) echo caption= / %i% >> %%~na.txt 

which gives me text files correct names , part of content including total number of files need each file created different first caption= 1 / 64 , second 2 / 64 example.

can please me have sore head :)

does want?

@echo off setlocal enabledelayedexpansion  /f "tokens=1 delims= " %%a in ('dir *.jpg^|find "file(s)"') (set numfiles=%%a) set /a i=0 /f %%f in ( 'dir /b /a-d %1"*.jpg"' ) (    set /a i=i+1 & echo caption= !i! / %numfiles% > %%~nf.txt ) 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -