Skip navigation
Currently Being Moderated

Bridge CS6 - How to rename 50,000 RAW Files?

Aug 9, 2012 9:53 PM

Hi Folks,

 

Let me just say this, so I can get it off my chest ... Adobe why on earth did you make these forums the most maddeningly formatted I have ever used. Not intuitive at all and needlessly complicated and precious. I thought you guys were good at this stuff?

 

Whew ...

 

I have about 50,000 raw files all rated, labeled and keyworded. They are in about 450 folders but the numbering of the files is just whatever my particular Canon camera of the day had at the time. I'd like to change the filenames to my initial and last name, date (YR,MONTH,DAY), a number from 0001-9999 (for that particular date) and a two letter suffix.

 

For instance:

 

fguy_120109_0001_SF.CR2

 

The question is, is there some way to automate this without having to go to each folder separately, select all the files and rename? Can this be automated? Otherwise thats 450 folders to deal with.

 

Suggestions please.

 
Replies
  • Currently Being Moderated
    Aug 10, 2012 1:35 AM   in reply to Five0Guy

    Batch Rename under menubar/tools can do all of the above… Very easy to use ( has regexp too ) Script could do all your folders in 1 go… Depending on your platform you could also do this outside of Bridge…

     

    Screen shot 2012-08-10 at 09.34.30.png

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 10, 2012 7:27 AM   in reply to Five0Guy

    Learning to script is not something thats done overnight… Well for me it was/isn't… If you require lots of scripted solutions its worth while it can save you lots of time but theres a learning curve… If this is your only need then someone may help but you would need to supply more details… I don't have CS6 but that may or may not be a problem… What OS are you using and where are the folders all in the same directory?

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 11, 2012 9:24 AM   in reply to Five0Guy

    Hello, I've put bridge as the script target for this although it isn't actually using Bridge scripting commands… Give it a try on a smaller selection and see if it works… I only tested with 4 folders of a dozen files each looks pretty close to what you asked although date is vauge… Created date, modified date todays date?

     

    #target bridge
     
    reNameFiles();
     
    function reNameFiles() {
     
              var top = Folder.selectDialog( 'Please select the top level folder' );
     
              if ( top != null ) {
     
                        var crFiles, folders, countA, countB, i, j, date, newName;
     
                        folders = top.getFiles();
     
                        countA = folders.length;
     
                        for ( i = 0; i < countA; i++ ) {
     
                                  if ( folders[i] instanceof Folder ) {
     
                                            crFiles = folders[i].getFiles( /\.CR2$/i );
     
                                            countB = crFiles.length;
     
                                            for ( j = 0; j < countB; j++ ) {
     
                                                                date = '120109_'; // You may need to change this…??????
     
                                                                newName = 'fguy_' + date + zeroPad( j, 4 ) + '_SF.CR2';
     
                                                                crFiles[j].rename( newName ); 
     
                                            };
     
                                  };
     
                        };
     
              };
     
    };
     
    function zeroPad( n, p ) {
     
      var t = n.toString();
     
              while ( t.length < p ) { t = '0' + t };
     
      return t;
     
    };
     
    
     
    |
    Mark as:
  • Currently Being Moderated
    Aug 11, 2012 9:35 AM   in reply to Muppet Mark

    Ha ha… just noticed I started numbering from zero (idiot)… that's why Im a muppet…

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 12, 2012 5:29 AM   in reply to Muppet Mark

    Was pottering about so I put some date options in and fixed my zero error…

     

    #target bridge
    
    reNameFiles();
    
    function reNameFiles() {
    
         var top = Folder.selectDialog( 'Please select the top level folder' );
    
         if ( top != null ) {
    
              var crFiles, folders, countA, countB, i, j, date, newName;
    
              folders = top.getFiles();
    
              countA = folders.length;
    
              for ( i = 0; i < countA; i++ ) {
    
                   if ( folders[i] instanceof Folder ) {
    
                        crFiles = folders[i].getFiles( /\.CR2$/i );
    
                        countB = crFiles.length;
    
                        for ( j = 0; j < countB; j++ ) {
    
                             //date = '120109'; // A hard coded String Date…
    
                             date = new Date(); // Today's Date
    
                             //date = crFiles[j].modified;  // File Modified Date
    
                             //date = crFiles[j].created; // File Created Date
    
                             date = getDateYYMMDD( date );
    
                             newName = 'fguy_' + date + '_' + zeroPad( j+1, 4 ) + '_SF.CR2';
    
                             crFiles[j].rename( newName ); 
    
                        };
                   };
              };
         };
    };
    
    
    function zeroPad( n, p ) {
    
         var t = n.toString();
    
              while ( t.length < p ) { t = '0' + t };
    
         return t;
    
    };
    
    
    function getDateYYMMDD( d ) {
    
         var yy = String( d.getFullYear() ).substring( 2, 4 );
    
         var mm = d.getMonth() + 1;
    
         if ( mm < 10 ) { mm = '0' + mm };
    
         var dd = d.getDate();
    
         if ( dd < 10 ) { dd = '0' + dd };
    
         return yy + mm + dd;
    
    };
    
     
    |
    Mark as:
  • Currently Being Moderated
    Aug 12, 2012 8:13 AM   in reply to Five0Guy

    As it stands the above will run-in bridge as target… To run it would be best just to use the ExtendScript Toolkit… This can be found…

     

    HD/Applications/Utilities/Adobe Utilities - CS5/ExtendScript Toolkit.app

     

    Just cut and paste from here into a new window and run… ( on a test folder first )

     

    It should ask you to select a top level folder/directory…

     

    It currently uses today's date but I also left other options behind comments… the // lines…

     

    Any problems give us a shot back should be close to what you asked…

     

    If you like it save it using the Toolkit… It's possible to add this to Bridge UI if wanted…

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 14, 2012 3:34 PM   in reply to Five0Guy

    How or where the date part of the new name comes from is purely down to you… You didn't indicate that was the case that's why I asked and offered several possibilities… Sure if that is the case then it's easy enough to get the name of the parent folder and use that…

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points