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.

| improve this question | |
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.....
| improve this answer | |
  • 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. – Louis Waweru Feb 27 '15 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... – Oliver Friedrich Feb 27 '15 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 '15 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. – Louis Waweru Feb 27 '15 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. :) – Peter Cordes Feb 27 '15 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.

| improve this answer | |
3

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

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

| improve this answer | |
3

This would probably be better asked on SoftwareRecommendations.SE, but I will say that I have used the free Bulk Rename Utility on many occasions and found it to be very helpful, easy to use, and extremely powerful.

Screenshot of Bulk Rename Utility

Unlike a lot of freeware, the interface is concise and native, and the software is entirely free so you don't have to be bothered with trial restrictions and annoyances common in freeware. I personally found it very helpful when organizing my music library.

(I am in no way affiliated with the author)

| improve this answer | |
  • +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 '15 at 14:07
  • +1 for informing me about softwarerecs.stackexchange.com. I had no idea that existed. – Feckmore Mar 6 '15 at 21:32
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
    )
)  
| improve this answer | |
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\

| improve this answer | |
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 ;-)

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.