6

I have two folders in Windows 8.1. The first folder, a, has 50 .jpg files numbered 01.jpg through to 50.jpg. My second folder, b, has the same amount of .jpg files named in the exact same manner.

My goal is to merge these two folders, but rename the files in b 51.jpg through to 100.jpg so that they stay in the same order.

1

7 Answers 7

13
  1. Select all the files from a folder. Rename the first file from the selection as a- numbering will take place on its own.
  2. Similarly rename b folder as b-
  3. Then move files from b folder to a. (Asuming you have sort on name)
  4. Again rename files as img-
    You will have the numbering as img-1.....
6
  • 1
    It matters which file is the first to get renamed, so it'd be good instruct renaming the first file in the selection, given that it's sorted. Feb 27, 2015 at 7:38
  • -1 cause it is simply a solution to do it manually, which in my opinion has nothing to do with a super user... Feb 27, 2015 at 8:36
  • @BeowulfOF You could probably use voice command to "automate" it a bit more. It might be a bit cumbersome, but it still gets the job done and it's probably the easiest/quickest solution that doesn't require any specific or additional setup.
    – Mario
    Feb 27, 2015 at 8:41
  • 2
    @BeowulfOF Typing the new name happens once... The other selected files will automatically get updated. It's actually much faster (mostly mouse work) and safer (supported by the undo button) for many than editing and running a script. Feb 27, 2015 at 11:38
  • 1
    I had no idea any GUI file browser had multi-file rename via selection semantics like this. Will have to try that in some GNU/Linux ones. (or just keep using prename s/foo/bar/ *.jpg to throw perl regexes at my file renaming problems. :) Feb 27, 2015 at 15:30
13

Windows 8.1 have PowerShell build-in, so you can use something like this:

1..50|Rename-Item -Path {'{0:00}.jpg'-f$_} -NewName {'{0:00}.jpg'-f($_+50)}

In the above, the first 0 in {0:00} specifies the parameter index, and the second 00 specifies the format as two digits padded with zeroes.

4

This would probably be better asked on SoftwareRecommendations.SE. But here are my recommendations.


I have used the free Bulk Rename Utility on many occasions and found it to be very helpful. It's a little cluttered but extremely powerful.

Bulk Rename Utility


There is also PowerRename from Microsoft as part of their open source PowerToys suite. This is much less cluttered but slightly less powerful in some ways. However it does have support for RegEx renaming!

PowerRename

2
  • +1 for this. This is also my go-to tool for bulk renaming. The beauty of this tool is that one can 'preview' the result first, and the filelist pane allows renaming "all files but one/N" easily: Ctrl-A then just Ctrl-Click to unselect those you don't want to rename.
    – pepoluan
    Feb 28, 2015 at 14:07
  • +1 for informing me about softwarerecs.stackexchange.com. I had no idea that existed.
    – Feckmore
    Mar 6, 2015 at 21:32
3

Highly recommend IrfanView. It has the most amazing customization for bulk renaming files.

More details here: http://www.irfanview.com/faq.htm#Q13

2

This is old and maybe too complex, but in CMD.exe you could solve it like this:

@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION

SET COUNTER=1
FOR %%A IN ("a","b") DO (
    SET FOLDER=%%A
    FOR /F %%F IN ('DIR /B /ON !FOLDER!') DO (
        SET FILE=%%F
        COPY !FOLDER!\%%F c\!COUNTER!!FILE:~-4!
        SET /A COUNTER= !COUNTER! + 1
    )
)  
0

Similar to Niki above use DOS or the CMD utility.

In DOS C:\FolderA> (move to folder with A files)
Rename all the files in one go REN \*.jpg A-\*.jpg

go to B folder using CD - change directory
Rename all the files in one go REN \*.jpg B-\*.jpg

Then copy b-files to A folder.
Copy B\*.jpg c:\FolderA\

0

I'd recommend http://www.advancedrenamer.com/ as an alternative "easy-button" answer. I actually use it all the time for batch-renames where I need a certain pattern, or need to remove silliness from other people's mashed-up filenames ;-)

Not the answer you're looking for? Browse other questions tagged .