moving Gb's of pics to iPhoto - mass rename of files?

Discussion in 'Mac Apps and Mac App Store' started by btownguy, Jul 27, 2009.

  1. btownguy macrumors 6502a

    Jun 18, 2009
    I have multiple Gb's of photos I'll be migrating from Windows over to my Mac (iPhoto). I have them categorized in folders named after the events they represent. I've taken the pictures with various cameras over the years, and there is very little rhyme or reason to the file names. Lots of DSC_xxxx.jpg's, and IMG_xxxx.jpg's, etc. Does it make sense to do some kind of mass file rename before I begin working with them on the Mac in iPhoto?
  2. Darth.Titan macrumors 68030


    Oct 31, 2007
    Austin, TX
    Not really. The file name is inconsequential when working with them in iPhoto. I'd leave em as is.
  3. chenager macrumors newbie

    Aug 5, 2009
    Perl script for mass file renames

    The following Perl script renames multiple files quite nicely. In terminal create a new file called and here is the script:

    # rename: renames files according to the expr given on the command line.
    # The expr will usually be a 's' or 'y' command, but can be any valid
    # perl command if it makes sense. Takes a list of files to work on or
    # defaults to '*' in the current directory.
    # e.g.
    # rename 's/\.flip$/.flop/' # rename *.flip to *.flop
    # rename s/flip/flop/ # rename *flip* to *flop*
    # rename 's/^s\.(.*)/$1.X/' # switch sccs filenames around
    # rename 's/$/.orig/' */*.[ch] # add .orig to your source files in */
    # rename 'y/A-Z/a-z/' # lowercase all filenames in .
    # rename 'y/A-Z/a-z/ if -B' # same, but just binaries!
    # rename chop *~ # restore all ~ backup files

    use Getopt::Std;
    my ($subst, $name);

    if (!&getopts("nfq") || $#ARGV == -1) {
    die "Usage: rename [-fnq] <perl expression> [file file...]
    -f : Force the new filename even if it exists already
    -n : Just print what would happen, but don't do the command
    -q : Don't print the files as they are renamed
    e.g. : rename 's/\.c/.c.old/' *
    rename -q 'y/A-Z/a-z/' *\n";

    $subst = shift; # Get perl command to work on
    @ARGV = <*> if $#ARGV < 0; # Default to complete directory

    foreach $name (@ARGV) {
    $_ = $name;
    eval "$subst;";
    die $@ if $@;
    next if -e $_ && !$opt_f; # Skip if the file exists if asked to.
    next if $_ eq $name;
    if ($opt_n) {
    print "mv $name $_\n";
    print "mv $name $_\n" if !$opt_q;
    rename($name,$_) or warn "Can't rename $name to $_, $!\n";

    After you edit the file (use vi or similar) and exit the editor then make executable using 'chmod +x'. There are examples in the script to see how it works. Try it out and have fun.

  4. MWPULSE macrumors 6502a


    Dec 27, 2008
    what you can also do is use iphoto's batch change operation to change it the whole library to sequential numbers. It might be less useful than the script suggested, but it helped me out a lil bit when i was bored n fed up with all my files being higglypiggedly. cmd>shft>B should sort you out :)

  5. maflynn Moderator


    Staff Member

    May 3, 2009
    I agree with the other poster, renaming them makes little sense and isn't worth the effort.

Share This Page