Author Topic: Renaming file by excluding some signs (in this precise case: extension)  (Read 4676 times)

Offline CameraNera

  • Newcomer
  • *
  • Posts: 11
    • View Profile
Hello,

I am not completely a newbie in PhotoMecanic but still have lots to learn... ;D

I juste renamed a bunch of files using the "save selected photos as" function from my contact sheet.
I had RAW files and I wanted them to be lighter JPGS to show them to my costumer and used the variable "(new name of my file)_{filename}".

What bother me, it that I now have the file named "NewName_filenumber.RAW.jpg

But how could I exclude the letters "NEF", so that I only get "NewName_filenumber.jpg?

How could I have reached this result from the beginning while doing "saving as"?
And now that there is this mistake, can I correct it now with a new variable?

Is there a general way to suppress some signs in the name, no matter if they are letters or digits?

I am not really an expert with variables, as you can easily see  :-\

If anybody has a hint, I would be very glad to read it here and improve my knowledge of this great software.

Thanks a lot in advance,
best greetings from Europe,

CameraNera
« Last Edit: February 07, 2014, 12:09:38 PM by CameraNera »

Offline Ben Curtis

  • Member
  • **
  • Posts: 95
    • View Profile
    • Snappertalk blog
Re: Renaming file by excluding some signs (in this precise case: extension)
« Reply #1 on: February 03, 2014, 04:49:18 AM »
Use the variable {filenamebase} instead of {filename} will do what you want. I'm not sure if there's any way to correct what you've already done though...

Offline CameraNera

  • Newcomer
  • *
  • Posts: 11
    • View Profile
Re: Renaming file by excluding some signs (in this precise case: extension)
« Reply #2 on: February 03, 2014, 06:13:49 AM »
Hi Ben,

thanks a lot, that's perfect.

I just tried it, took me not even one second and a half  :D Super!
And no problem, I will just erase the files with the "wrong" name... that's easier than trying to correct them I guess.

But I just would be curious, which is the way in general to tell PhotoMecanic to "erase" some signs of the name.
I found this topic (http://forums.camerabits.com/index.php?topic=8581.msg41498#msg41498) mentioning the variable {filenamebase:-4}.

To summarize, this variable makes for exemple 1234 out of DSC_1234

So it seems to me that the part "-4" means "take away the four first signs of the file's name"?

And if so, what if I wish to change signs at the middle or at the end of the file's name?

I hope I am clear enough in expressing myself with that additional question  ::)

Best regards,
CameraNera

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25020
    • View Profile
    • Camera Bits, Inc.
Re: Renaming file by excluding some signs (in this precise case: extension)
« Reply #3 on: February 03, 2014, 07:54:54 AM »
CameraNera,

But I just would be curious, which is the way in general to tell PhotoMecanic to "erase" some signs of the name.
I found this topic (http://forums.camerabits.com/index.php?topic=8581.msg41498#msg41498) mentioning the variable {filenamebase:-4}.

To summarize, this variable makes for exemple 1234 out of DSC_1234

So it seems to me that the part "-4" means "take away the four first signs of the file's name"?

And if so, what if I wish to change signs at the middle or at the end of the file's name?

You would use the variables substring extraction multiple times and string them together.  So let's say you have DSC_1234 and you want it to become DSC_MyNewText_1234.  You would use:

{filenamebase:0,3}_MyNewText_{filenamebase:-4}

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

HTH,

-Kirk

Offline CameraNera

  • Newcomer
  • *
  • Posts: 11
    • View Profile
Hello Kirk

Thanks a lot for your indications and the link to the manual, that is exactly what I was looking for ;D
I am already looking forward for the next files to be renamed!

And sorry for the delayed answer, I was not a lot online those last days.

Best regards,
CameraNera