Windows 10: How do I accomplish renaming bulky indexed files to smaller number? Solved

  1.    02 Dec 2017 #1

    How do I accomplish renaming bulky indexed files to 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
      My ComputerSystem Spec

  2.    02 Dec 2017 #2

    budi said: View Post
    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
    You could create a batchfile e.g. rennum.bat

    Using following from admin command prompt



    Dir /b /s > dir.txt

    Then create a batch file rennum.bat with

    rename

    Repeated many times.

    Then use notepad++ which supports block column copy to paste all of contents of dir.txt after the rename commands. Then paste same data shifted up one line after the first block.

    Microsoft OneDrive - Access files anywhere. Create docs with free Office Online.
    Last edited by cereberus; 02 Dec 2017 at 07:14.
      My ComputerSystem Spec

  3.    02 Dec 2017 #3

    I'd 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
      My ComputerSystem Spec

  4.    02 Dec 2017 #4

    I'd 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
      My ComputerSystem Spec

  5.    03 Dec 2017 #5

    You can also do this in PowerShell:

    Code:
    foreach ($file in Get-ChildItem -Filter *.c -Recurse) {
      if ($file.fullname -match '\\([0-9]+?)\.c') {
        Rename-Item $file.fullname ([string]($matches[1]-1)+'.c')
      }
    }
      My ComputerSystem Spec


 

Related Threads
Command Prompt Input Error renaming update files in Windows Updates and Activation
164938 this was driving me crazy and the virtual assistant's suggestions bore no fruit so I thought I'd try this Cant install windows 10 updates - Microsoft Community 164939
Solved Renaming of many files. in General Support
I have done it before, but cannot remember what to do. I have a bunch of pictures from the Grand Canyon, taken on different cameras and cell phones. All have differed names and I would like to make them all the same like: change from:...
Hello, I have Windows 10 on a 2TB HDD with about 1TB of the HDD full. I would like to migrate Windows to an 80GB SSD but I can't find anyway to do this without cloning the entire drive, which I can't do because there is too much content on the HDD....
I have a new laptop, so unless this is some weird feature that's specific to the laptop, then I assume it's a Windows 10 settings issue because I've never encountered anything like this before. I downloaded several JPGs and PDFs from various emails...
Hi there whilst trying to rename a "new folder" I would start typing and then a few letters into the name it will throw me off the new folder icon and take me back to the top of the page with the "new folder" un touched. Same issue in pictures...
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 04:33.
Find Us