why is the variable "number" not increasing when the FOR loop goes over it again?
setLocal EnableDelayedExpansion
for /f "tokens=* delims= " %%a in (input.txt) do (
set /a N+=1
set /a number=!number!+1
echo %%a !number!.jpg >output.txt
)
why is the variable "number" not increasing when the FOR loop goes over it again?
setLocal EnableDelayedExpansion
for /f "tokens=* delims= " %%a in (input.txt) do (
set /a N+=1
set /a number=!number!+1
echo %%a !number!.jpg >output.txt
)
OK, try this please:
In case of redirection you need
>>output.txt
or a code block (parentheses) and>output.txt
.First of all I don't recommend you to enable expansion of variables when you are working with filenames, use it only if you really know what means enabling the delayedexpansion, the benefits (improved velocity) and the negatives (missing characters).
Also you are assigning a value for the variable "N" but you don't use that var.
Here is the code:
You should try
EDIT Or try:
Or maybe that ++ isnt even supported by what you are using to program this. Let me know though!
Shadowpat