How do I accomplish renaming indexed files to its below ?

abdulbadii

Banned
Messages
6
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
 

My Computer

System One

  • OS
    windows 8
[FONT=&quot]I'd solve and answer mine. on Windows cmd.exe console:[/FONT]
[FONT=&quot]
[/FONT]
[FONT=&quot]cmd /v /k[/FONT]
[FONT=&quot]for /f %x in ('dir /b ??.c') do (set/a t=%~nx-1 &ren %x !t!.c)[/FONT]
[FONT=&quot]
[/FONT]

[FONT=&quot]rename to greater number; dir in reversed and +1, i.e. use:[/FONT]
[FONT=&quot]
[/FONT]

[FONT=&quot]dir /b /o-n[/FONT]
[FONT=&quot]t =%~nx+1[/FONT]
[FONT=&quot]
[/FONT]

[FONT=&quot]Much better is to get TCC/LE more improved and sensible cmd.exe duplicate[/FONT]
 

My Computer

System One

  • OS
    windows 8
Back
Top