Author Topic: Automated file renaming by removing info from file name  (Read 3518 times)

Offline jeremynicholl

  • Newcomer
  • *
  • Posts: 17
    • View Profile
Automated file renaming by removing info from file name
« on: January 24, 2015, 07:30:18 AM »
I have a number of files that I need to rename in a very specific fashion. I need to keep the 2 letter country code, 6 digit number and <.jpg> suffix, but remove everything before the 2 letter country code. For example:

<russia-business-lebedev-ru159521.jpg> should become <ru159521.jpg>

<russia-moscow-victory-parade-ru150898.jpg> should become <ru150898.jpg>

The current file numbers are of varying lengths because the keywords that make up everything before the country code differ depending on subject matter. I’m sure PM can do what I need with a variable that counts in from the right to keep the 2 letter country code, 6 digit number and <.jpg> suffix while removing everything before the country code.

However I’m unable to work out what the variable should be. Anyone have any suggestions?

Thanks in advance,

Jeremy Nicholl

Offline jeremynicholl

  • Newcomer
  • *
  • Posts: 17
    • View Profile
Re: Automated file renaming by removing info from file name
« Reply #1 on: January 24, 2015, 08:19:15 AM »
And the answer is...
{filenamebase:-8}

I thank myself  :)