Author Topic: Shorten a File Name?  (Read 1958 times)

Offline mamer2005

  • Newcomer
  • *
  • Posts: 7
    • View Profile
Shorten a File Name?
« on: July 22, 2015, 10:51:56 AM »
I need to shorten a couple thousand file names from 16 characters to 7 plus the extension (i.e. from AB_1234-12341212.jgp to AB_1234.jgp). Is there a variable that will do this? The Filenamebase only takes the last characters from the name.

Thanks, Joe

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24391
    • View Profile
    • Camera Bits, Inc.
Re: Shorten a File Name?
« Reply #1 on: July 22, 2015, 12:48:37 PM »
Joe,

I need to shorten a couple thousand file names from 16 characters to 7 plus the extension (i.e. from AB_1234-12341212.jgp to AB_1234.jgp). Is there a variable that will do this? The Filenamebase only takes the last characters from the name.

{filenamebase} is the variable you want to use, but you'll need to use Variable Substring Extraction as explained here:

http://wiki.camerabits.com/en/index.php?title=User_Manual_Flat_View#Variable_Substring_Extraction

So in your case if you always need the first seven characters, you would use

{filenamebase:0,7}

HTH,

-Kirk

Offline mamer2005

  • Newcomer
  • *
  • Posts: 7
    • View Profile
Re: Shorten a File Name?
« Reply #2 on: July 22, 2015, 01:12:38 PM »
Thanks, Kirk!