HELP WITH BATCH RENAMING PLEASE :)

smadgos

macrumors newbie
Original poster
Mar 10, 2017
2
0
Hello guys,
Hopefully i am posting this one in the right place.
I need to batch rename photos from my camera in a specific way and can't find how to.
What i basically need is to batch rename my photos so that each 3 photos will carry the same number but with a different letter (A\B\C)
The photos will be sort by date taken before the renaming.

For Example:
These are the photo's names in the folder:
IMG_6001
IMG_6002
IMG_6003
IMG_6004
IMG_6005
IMG_6006
IMG_6007
IMG_6008
IMG_6009

The result i need is:
1A
1B
1C
2A
2B
2C
3A
3B
3C

ANY INFO would be HIGHLY appriciated!
Thanks in advance!
Elad
 

flyinmac

macrumors 68040
Sep 2, 2006
3,576
2,453
United States
The tool I like is called:

A Better Finder Rename

You can find it in the Mac App Store.

You can also google for it if you prefer that route. I've used it before, and it's a very powerful tool for these purposes.

You can read about it and other similar tools in an article published in MacWorld at the following link.

http://www.macworld.com/article/208...me-review-easily-rename-batches-of-files.html

I think you'll find that it's what you're looking for.

Always test on copies until you verify that it is doing what you expect.
 

Padaung

macrumors 6502
Jan 22, 2007
462
78
UK
Another option is Name Changer

However, I'm not sure it will allow renaming with a sequence of letters. However, renaming with a sequence of numbers is a standard with any renaming software as far as I know.
 

Toutou

macrumors 6502a
Jan 6, 2015
673
957
Prague, Czech Republic
Copy and paste this into Terminal. I tested it on a folder of (IMG_6001.jpg IMG_6002.jpg IMG_6003.jpg ….)

Code:
bash -c 'clear;echo "Please drag n drop the target folder into this window."; echo "Should look like this: /path/to/folder"; echo -n "Input: "; read folder; cd $folder; if [ $? -ne 0 ] ; then echo "Wrong input, cant access directory, aborting"; read; exit; fi; I=0; for filename in $(ls); do let "A=((I%9)/3)+1"; let "B=I%3"; case "$B" in 0) B=A;; 1) B=B;; 2) B=C;; esac; extension="$(echo $filename | grep -o "\.[^\.]*$")"; newname="$A$B$extension"; echo "Renaming $filename to $newname"; mv $filename $newname; let "I++"; done; echo "---All done!---"; read;'
 

smadgos

macrumors newbie
Original poster
Mar 10, 2017
2
0
Toutou - you are AMAZING!!! Thank you so much for this.
It worked almost Perfectly and maybe you could figure out how to make it perfect.
I had 1500 images in the folder therefore i expected the last files would be renamed " 500 a/b/c "
the problem is that the code is somehow limited to only renaming the files up to 3 a/b/c
all photos that should have been renamed from 4a and on simply disappeared from the folder.
Luckily i ran this test on a COPY folder so i still have the original images.
Can you help me with this PLEASE?
[doublepost=1491076201][/doublepost]
Copy and paste this into Terminal. I tested it on a folder of (IMG_6001.jpg IMG_6002.jpg IMG_6003.jpg ….)

Code:
bash -c 'clear;echo "Please drag n drop the target folder into this window."; echo "Should look like this: /path/to/folder"; echo -n "Input: "; read folder; cd $folder; if [ $? -ne 0 ] ; then echo "Wrong input, cant access directory, aborting"; read; exit; fi; I=0; for filename in $(ls); do let "A=((I%9)/3)+1"; let "B=I%3"; case "$B" in 0) B=A;; 1) B=B;; 2) B=C;; esac; extension="$(echo $filename | grep -o "\.[^\.]*$")"; newname="$A$B$extension"; echo "Renaming $filename to $newname"; mv $filename $newname; let "I++"; done; echo "---All done!---"; read;'
#5
Toutou - you are AMAZING!!! Thank you so much for this.
It worked almost Perfectly and maybe you could figure out how to make it perfect.
I had 1500 images in the folder therefore i expected the last files would be renamed " 500 a/b/c "
the problem is that the code is somehow limited to only renaming the files up to 3 a/b/c
all photos that should have been renamed from 4a and on simply disappeared from the folder.
Luckily i ran this test on a COPY folder so i still have the original images.
Can you help me with this PLEASE?
 

jasnw

macrumors 6502a
Nov 15, 2013
808
838
Seattle Area (NOT! Microsoft)
I'm not a bash expert, but I think if you change the section in the code string that reads
Code:
do let "A=((I%9)/3)+1"
to
Code:
do let "A=(I/3)+1"
that should do what you want. As always, try this out on a copy before risking everything.
 

Toutou

macrumors 6502a
Jan 6, 2015
673
957
Prague, Czech Republic
I'm not a bash expert, but I think if you change the section in the code string that reads
Code:
do let "A=((I%9)/3)+1"
to
Code:
do let "A=(I/3)+1"
that should do what you want. As always, try this out on a copy before risking everything.
Exactly! I left there a modulo operation from an earlier attempt.

correct:
Code:
bash -c 'clear;echo "Please drag n drop the target folder into this window."; echo "Should look like this: /path/to/folder"; echo -n "Input: "; read folder; cd $folder; if [ $? -ne 0 ] ; then echo "Wrong input, cant access directory, aborting"; read; exit; fi; I=0; for filename in $(ls); do let "A=(I/3)+1"; let "B=I%3"; case "$B" in 0) B=A;; 1) B=B;; 2) B=C;; esac; extension="$(echo $filename | grep -o "\.[^\.]*$")"; newname="$A$B$extension"; echo "Renaming $filename to $newname"; mv $filename $newname; let "I++"; done; echo "---All done!---"; read;'
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.