Author Topic: Renaming files  (Read 7011 times)

Offline Nessa

  • Newcomer
  • *
  • Posts: 36
    • View Profile
Renaming files
« on: June 01, 2007, 08:10:50 PM »
Greetings,
A while back I had trouble Batch renaming files -- then learned how.

However, I have come across something peculiar.

I successfully renamed two folders with the identical filename structure:
crocker_052407_0081.jpg
by using myname_052407_{frame}
and got
myname_052407__0081.jpg

However, when I went to the third folder, only the first file in the folder would respond correctly. Thereafter, the number would not stay. For example:

Files in folder --
crocker_052407_0020.jpg
crocker_052407_0026.jpg

I used
myname_052407_{frame}

and got
myname_052407_0020.jpg
myname_052407_.jpg (this one should have also had 0026).

I have tried several times, including quitting Photo Mechanic and starting again.

If it had not have worked with the previous two folders, each with the identical naming scheme, I would not have become so perplexed.

Any help is appreciated.

Thanks,

folsombob




Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25020
    • View Profile
    • Camera Bits, Inc.
Re: Renaming files
« Reply #1 on: June 01, 2007, 09:21:43 PM »
A while back I had trouble Batch renaming files -- then learned how.

However, I have come across something peculiar.

I successfully renamed two folders with the identical filename structure:
crocker_052407_0081.jpg
by using myname_052407_{frame}
and got
myname_052407__0081.jpg

However, when I went to the third folder, only the first file in the folder would respond correctly. Thereafter, the number would not stay. For example:

Files in folder --
crocker_052407_0020.jpg
crocker_052407_0026.jpg

I used
myname_052407_{frame}

and got
myname_052407_0020.jpg
myname_052407_.jpg (this one should have also had 0026).

I have tried several times, including quitting Photo Mechanic and starting again.

If it had not have worked with the previous two folders, each with the identical naming scheme, I would not have become so perplexed.

Depending on which camera was used to take the photo, the frame number may or may not be persistent.  Photo Mechanic, during Ingest, infers the frame number from the original camera filename and tucks the value away in the file.  If the file was modified (re-saved) by an application other than Photo Mechanic then this data can be lost.  Then if the image does not have a persistent frame number in the maker note, the frame number cannot be inferred and the frame variable will expand to nothing.

My advice would be to tuck the original filename away during Ingest in an IPTC field that you don't use often, for instance "Object Name".  Just use {filenamebase} in the Object Name field when applying the IPTC Stationery Pad during Ingest.  Later you can get the digits by using {object:-4} which will extract the last four characters of the filename (requires 4.5.1.1 or higher to do the substring extraction.)

The good thing about using the IPTC data is that most applications will preserve all of the IPTC data, even when re-saving the file.

-Kirk

Offline Hayo Baan

  • Uber Member
  • ******
  • Posts: 2552
  • Professional Photographer & Software Developer
    • View Profile
    • Hayo Baan - Photography
Re: Renaming files
« Reply #2 on: June 03, 2007, 01:49:16 AM »
You could also use the {actuations} variable; that would give you the shuttercount of your camera.
Hayo Baan - Photography
Web: www.hayobaan.nl

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25020
    • View Profile
    • Camera Bits, Inc.
Re: Renaming files
« Reply #3 on: June 03, 2007, 06:40:58 AM »
You could also use the {actuations} variable; that would give you the shuttercount of your camera.

The actuation count is also not supported on all cameras.

-Kirk

Offline Nessa

  • Newcomer
  • *
  • Posts: 36
    • View Profile
Re: Renaming files
« Reply #4 on: June 03, 2007, 07:25:14 PM »
Thanks, Kirk

All of the shots were taken with Nikon D2X.
As far as I know, I didn't do anything to them -- except batch rename them in Photo Mechanic, changing the original _DSC etc to crocker_052407_0020.jpg.

I later attempted to change them again, which worked in the first two folders.

Next time, I will try Ingesting them via PM, using your suggestions.

Thanks,

folsombob