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 6502

    Joined:
    Jun 18, 2009
    #1
    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

    Darth.Titan

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

    Joined:
    Aug 5, 2009
    #3
    Perl script for mass file renames

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

    #!/usr/bin/perl
    # 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";
    next;
    }
    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 rename.pl executable using 'chmod +x rename.pl'. There are examples in the script to see how it works. Try it out and have fun.

    Chuck
     
  4. MWPULSE macrumors 6502a

    MWPULSE

    Joined:
    Dec 27, 2008
    Location:
    London
    #4
    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 :)

    PTP
     
  5. maflynn Moderator

    maflynn

    Staff Member

    Joined:
    May 3, 2009
    Location:
    Boston
    #5
    I agree with the other poster, renaming them makes little sense and isn't worth the effort.
     

Share This Page