HELP WITH BATCH RENAMING PLEASE :)

Discussion in 'Mac Apps and Mac App Store' started by smadgos, Mar 10, 2017.

  1. smadgos macrumors newbie

    Joined:
    Mar 10, 2017
    #1
    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
     
  2. flyinmac macrumors 68030

    flyinmac

    Joined:
    Sep 2, 2006
    Location:
    United States
    #2
    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.
     
  3. Padaung macrumors 6502

    Padaung

    Joined:
    Jan 22, 2007
    Location:
    UK
    #3
    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.
     
  4. Toutou macrumors 6502a

    Toutou

    Joined:
    Jan 6, 2015
    Location:
    Prague, Czech Republic
    #4
    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. smadgos thread starter macrumors newbie

    Joined:
    Mar 10, 2017
    #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?
    --- Post Merged, Apr 1, 2017 ---
    #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?
     
  6. jasnw macrumors 6502

    Joined:
    Nov 15, 2013
    Location:
    Seattle Area (NOT! Microsoft)
    #6
    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.
     
  7. Toutou macrumors 6502a

    Toutou

    Joined:
    Jan 6, 2015
    Location:
    Prague, Czech Republic
    #7
    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;'
     

Share This Page