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.

Giacomo1968
  • 58,727
Max
  • 77

7 Answers7

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.....
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.

user
  • 30,336
user364455
  • 3,069
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

Keavon
  • 1,171
3

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

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

Sam P
  • 131
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

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 ;-)

NateJ
  • 236
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\

Nifle
  • 34,998