Skip to content

Make it increment a number by one #1

@devallllll

Description

@devallllll

Would like to have something like

:: Increment the last digit of each number in the path
FOR /L %%i IN (0,1,31) DO (
SET "char=!source:%%i,1!"
IF "!char!" GEQ "0" IF "!char!" LEQ "9" (
SET "num=!num!!char!"
) ELSE (
IF DEFINED num (
SET /A "lastDigit=!num:
-1!+1"
SET "num=!num:~0,-1!!lastDigit!"
SET "newPath=!newPath!!num!"
SET "num="
)
SET "newPath=!newPath!!char!"
)
)
IF DEFINED num SET "newPath=!newPath!!num!"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions