Author Topic: Help with renaming files  (Read 4579 times)

Offline johnricardnyc

  • Newcomer
  • *
  • Posts: 4
    • View Profile
Help with renaming files
« on: October 11, 2009, 08:15:21 PM »
I am changing the way I name files.  If I shot a photo in August of let's say, Mary I used to name it as follows.

Mary0809_jr{seqn}

The 4 digit number represents 2 digits for the month and 2 digits for the year followed by my initials and then the sequence number.

Now I would like to change the naming method to this:

Mary200908_jr{seqn}

Now the numbers would represent 4 digits for the year followed by 2 digits for the month.

Is there a way to have PM change the old date method to the new date method?

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25020
    • View Profile
    • Camera Bits, Inc.
Re: Help with renaming files
« Reply #1 on: October 11, 2009, 08:36:31 PM »
John,

I am changing the way I name files.  If I shot a photo in August of let's say, Mary I used to name it as follows.

Mary0809_jr{seqn}

The 4 digit number represents 2 digits for the month and 2 digits for the year followed by my initials and then the sequence number.

Now I would like to change the naming method to this:

Mary200908_jr{seqn}

Now the numbers would represent 4 digits for the year followed by 2 digits for the month.

Is there a way to have PM change the old date method to the new date method?

Since your renaming style is fairly unchanging, all you need to do is:

1) Select all of the images.
2) Open the Rename Photos dialog and reset the Sequence number back to your initial value.
3) Set the Renaming string to:

Mary{year4}{month0}_jr{seqn}

Then rename the photos.

That should do it.

-Kirk

Offline johnricardnyc

  • Newcomer
  • *
  • Posts: 4
    • View Profile
Re: Help with renaming files
« Reply #2 on: October 11, 2009, 10:52:35 PM »
That works perfectly and it will save me a ton of time. 

Another question.  Is there a way to make the program only change the old date and keep the rest of the file name exactly as it was?  In other wrods I would want to keep the information that I am putting in bold in this example:

Mary0809_jr{seqn}

The reason I am asking is that my "selects" folders have images that are not in sequence and it would be great if I could just change the date part of those files without changing the name "Mary" and the original sequence number the image has.

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25020
    • View Profile
    • Camera Bits, Inc.
Re: Help with renaming files
« Reply #3 on: October 11, 2009, 11:05:44 PM »
That works perfectly and it will save me a ton of time. 

Another question.  Is there a way to make the program only change the old date and keep the rest of the file name exactly as it was?  In other wrods I would want to keep the information that I am putting in bold in this example:

Mary0809_jr{seqn}

The reason I am asking is that my "selects" folders have images that are not in sequence and it would be great if I could just change the date part of those files without changing the name "Mary" and the original sequence number the image has.

There is the ability to extract portions of a filename (or any other variables) to create a new naming string.  It is called 'variables substring extraction' and it is very powerful, but your strings need to not vary in length.  Does your sequence part of your filename have a consistent number of characters?  (Did you make your sequence number start out like: '001' or did you just start it out as '1'?)

If your sequence was 001 then the following would extract the end of your filename (jr+sequence digits) :

{filenamebase:-5}

The following would extract the 'Mary' part:

{filenamebase:0,4}

So you might do something like this:

{filenamebase:0,4}{year4}{month0}{filenamebase:-5}

If you have any questions, please let me know.

-Kirk

Offline johnricardnyc

  • Newcomer
  • *
  • Posts: 4
    • View Profile
Re: Help with renaming files
« Reply #4 on: October 12, 2009, 06:30:05 AM »
I'm trying to follow the instructions here, but its really unclear.  Can you explain what the numbers and colons mean in your Filename instructions?  Maybe that would help.  How is the program seeing my old naming convention?

Mary0809_jr{seqn}

Is it seeing 5 different elements (name, number, underscore, initials, sequence) or is something else happening?

I am trying to understand why you have a "0,4" or a "-5" after the Filename command.  What do these numbers represent?

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25020
    • View Profile
    • Camera Bits, Inc.
Re: Help with renaming files
« Reply #5 on: October 12, 2009, 06:57:33 AM »
I'm trying to follow the instructions here, but its really unclear.  Can you explain what the numbers and colons mean in your Filename instructions?  Maybe that would help.  How is the program seeing my old naming convention?

Mary0809_jr{seqn}

Is it seeing 5 different elements (name, number, underscore, initials, sequence) or is something else happening?

I am trying to understand why you have a "0,4" or a "-5" after the Filename command.  What do these numbers represent?

Variable Substring Extraction is explained in more detail in the manual, so you may want to look it up.  In the example I gave you, PM isn't 'seeing' your old naming scheme.  I have PM using the current name of any selected files by using {filenamebase} (the base filename without the extension, eg. JPEG) and I am using the extraction syntax to pull out the 'Mary' part, and the 'jr0001' part.  So in my example:

{filenamebase:0,4}{year4}{month0}{filenamebase:-5}

The first part extracts the first four characters of the current filename (0,4).  The second part generates a four digit year.  The third part generates a two digit month.  The last part extracts the last five characters of the current filename (-5) assuming that your sequence number you previously used always consisted of three digits, like 001, 002, etc.

HTH,

-Kirk

P.S. The current 4.6.x manual is available for download from the Announcements section of these forums.