Author Topic: Code replace at the end of a name string  (Read 4926 times)

Offline mbbphoto

  • Sr. Member
  • ****
  • Posts: 312
    • View Profile
Code replace at the end of a name string
« on: May 28, 2010, 07:09:58 AM »
Mac 10.5.7 PM 4.6.4

Can I Code replace at the end of a name string with varying file name lengths.

ie:  Joe_Fry_3003.jpg > Joe_Fry_10_20.jpg

      James_Connor_2345.jpg   >   Joe_Fry_10_20.jpg 

Marc
Marc

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25020
    • View Profile
    • Camera Bits, Inc.
Re: Code replace at the end of a name string
« Reply #1 on: May 28, 2010, 08:12:22 AM »
Marc,

Mac 10.5.7 PM 4.6.4

Can I Code replace at the end of a name string with varying file name lengths.

ie:  Joe_Fry_3003.jpg > Joe_Fry_10_20.jpg

      James_Connor_2345.jpg   >   Joe_Fry_10_20.jpg 

I'm not sure I follow what you're trying to accomplish.  If all of the names are going to become Joe_Fry_10_20 then just use a simple renaming string.  Please note that PM will be forced to append either letters or digits to handle the non-unique filenames you're producing.

-Kirk

Offline mbbphoto

  • Sr. Member
  • ****
  • Posts: 312
    • View Profile
Re: Code replace at the end of a name string
« Reply #2 on: May 28, 2010, 07:22:20 PM »
Ooops, lets try that again.

Can I Code replace at the end of a name string with varying file name lengths.

ie:  Joe_Fry_3003.jpg > Joe_Fry_10_20.jpg

      James_Connor_2345.jpg   >   James_Connor_10_20.jpg


Apologies for the carelessness.

Marc
Marc

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25020
    • View Profile
    • Camera Bits, Inc.
Re: Code replace at the end of a name string
« Reply #3 on: May 28, 2010, 09:57:33 PM »
Marc,

Ooops, lets try that again.

Can I Code replace at the end of a name string with varying file name lengths.

ie:  Joe_Fry_3003.jpg > Joe_Fry_10_20.jpg

      James_Connor_2345.jpg   >   James_Connor_10_20.jpg

Do you always have four digits at the end?  If so, then Code Replacement is unnecessary.  This should work:

{filenamebase:0,-4}10_20

HTH,

-Kirk

Offline mbbphoto

  • Sr. Member
  • ****
  • Posts: 312
    • View Profile
Re: Code replace at the end of a name string
« Reply #4 on: June 02, 2010, 04:37:38 AM »
Perfect!
I was missing the 0.
Marc
Marc