• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

How do I accomplish renaming numbered files to its smaller number

How do I accomplish renaming bulky indexed files to its smaller index number, with any kind of tools ?
That is to rename

1.c -> 0.c

2.c -> 1.c

...

7.c -> 6.c

8.c -> 7.c

9.c -> 8.c
...
...
(in large numbers of files.) Thank so much in advance
 
There are some tools available for bulk renaming files, such as Ant Renamer.

If there are no gaps in your file names, e.g. you have a file for every number from 1-9 etc. then it's easy to do with the "enumeration" action in Ant Renamer. If there are gaps then I think it will still be possible by using the "regular expression" action, but it's complicated.
 
I solve and answer mine. on Windows cmd.exe console:

cmd /v /k
for /f %x in ('dir /b ??.c') do (set/a t=%~nx-1 &ren %x !t!.c)

rename to greater number; dir in reversed and +1, i.e. use:

dir /b /o-n
t =%~nx-1

Much better is to get TCC/LE more improved and sensible cmd.exe duplicate
 
I'd solve and answer mine. on Windows cmd.exe console type:

cmd /v /k
for /f %x in ('dir /b ??.c') do (set/a t=%~nx-1 &ren %x !t!.c)

rename to greater number; dir in reversed and +1, i.e. use:

dir /b /o-n
set/a t =%~nx+1

Much better to get TCC/LE more improved and sensible cmd.exe duplicate
 
Back
Top