Author Topic: Rename issue: Replacing first 4 letter but keeping the rest?  (Read 5631 times)

Offline hilmartor

  • Full Member
  • ***
  • Posts: 178
    • View Profile
Hi,

I have a file called:
LBV 219.jpg

Would like it to be:
pho 219.jpg

I would like to remove the LBV and replacing it with another text but keeping the number. I have over 400 pics I jhave to do this to so manually it would take to much time. How can I do this with PM?

Using Mac, 10.4.9.

A quick response would be great (as usual).

-Hilmar

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24756
    • View Profile
    • Camera Bits, Inc.
Re: Rename issue: Replacing first 4 letter but keeping the rest?
« Reply #1 on: June 11, 2007, 06:39:16 AM »
Hilmar,

I have a file called:
LBV 219.jpg

Would like it to be:
pho 219.jpg

I would like to remove the LBV and replacing it with another text but keeping the number. I have over 400 pics I jhave to do this to so manually it would take to much time. How can I do this with PM?

Put the following in the Rename dialog:

pho {filenamebase:-3}

That should do it.

-Kirk

Offline mbbphoto

  • Sr. Member
  • ****
  • Posts: 312
    • View Profile
Re: Rename issue: Replacing first 4 letter but keeping the rest?
« Reply #2 on: June 11, 2007, 10:43:55 AM »
Where in the manual is this broken down?

ie:    pho {filenamebase:-3 } means the text will replace the first 3 letters.

For instance: How do you remove the first 3 digits and the last 3 (before the suffix).

How do you delete the first 3 letters?

How do you have it recognize spaces?

Thanks

Marc
Marc

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24756
    • View Profile
    • Camera Bits, Inc.
Re: Rename issue: Replacing first 4 letter but keeping the rest?
« Reply #3 on: June 11, 2007, 11:29:23 AM »
Marc,

Where in the manual is this broken down?

It isn't.  The new manual has not been written yet.

Quote from: mbbphoto
ie:    pho {filenamebase:-3} means the text will replace the first 3 letters.

Well not exactly.  The {filenamebase:-3} extracts the last three characters of the filename.  So we're building a new name comprising the letters "pho " and the last three characters of the current filename.

Quote from: mbbphoto
For instance: How do you remove the first 3 digits and the last 3 (before the suffix).

That's harder to do if your filenames are variable length.  But basically you do something like this:

{filenamebase:3,5}

...which would extract five characters, starting with the fourth character.  You'll need to know how long each filename is and adjust accordingly.

Quote from: mbbphoto
How do you delete the first 3 letters?

It's more like how do you keep everything but the first three letters?

{filenamebase:3}

(extracts from the fourth character to the end of the string.)

Quote from: mbbphoto
How do you have it recognize spaces?

I'm not sure what you're asking.  To the substring extraction feature, a space is just like any other character.  What is it that you're trying to accomplish?

-Kirk

Offline wiesiek

  • Newcomer
  • *
  • Posts: 34
    • View Profile
Re: Rename issue: Replacing first 4 letter but keeping the rest?
« Reply #4 on: June 12, 2007, 07:11:20 AM »
Wouldn't it be a good idea to allow an arbitrary regular expression pair to specify the rename source an target? It would of course be a kind of "advanced option" but very useful one  :)

Wiesiek

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24756
    • View Profile
    • Camera Bits, Inc.
Re: Rename issue: Replacing first 4 letter but keeping the rest?
« Reply #5 on: June 12, 2007, 07:33:19 AM »
Wiesiek,

Wouldn't it be a good idea to allow an arbitrary regular expression pair to specify the rename source an target? It would of course be a kind of "advanced option" but very useful one  :)

We've talked about adding regex to the renaming, find, etc. but it is not easy to use for most people.  We may still add it in the future.

-Kirk

Offline wiesiek

  • Newcomer
  • *
  • Posts: 34
    • View Profile
Re: Rename issue: Replacing first 4 letter but keeping the rest?
« Reply #6 on: June 12, 2007, 08:05:29 AM »
I know that regexps are not for everybody - that's why I suggested them as an "advanced option" - for thouse who want to have total control over the renaming process :) It's great to know that you have plans to add this to PM some day. I have almost decided to buy the license. PM is not cheap but it seems to be worth the money...

Wiesiek

Offline mbbphoto

  • Sr. Member
  • ****
  • Posts: 312
    • View Profile
Re: Rename issue: Replacing first 4 letter but keeping the rest?
« Reply #7 on: June 13, 2007, 08:07:25 AM »


Quote from: mbbphoto
ie:    pho {filenamebase:-3} means the text will replace the first 3 letters.

Well not exactly.  The {filenamebase:-3} extracts the last three characters of the filename.  So we're building a new name comprising the letters "pho " and the last three characters of the current filename.



Quote from: mbbphoto
How do you have it recognize spaces?

I'm not sure what you're asking.  To the substring extraction feature, a space is just like any other character.  What is it that you're trying to accomplish?

-Kirk


This is a great breakdown, thanks.


If you remove the last 3 characters does that include the suffix?

As far as the spaces go its more about INSERTING spaces (not so much in a file name but more often in Captions, the software seems to ignore spaces, carriage returns etc)
Marc

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24756
    • View Profile
    • Camera Bits, Inc.
Re: Rename issue: Replacing first 4 letter but keeping the rest?
« Reply #8 on: June 13, 2007, 09:04:07 AM »


Quote from: mbbphoto
ie:    pho {filenamebase:-3} means the text will replace the first 3 letters.

Well not exactly.  The {filenamebase:-3} extracts the last three characters of the filename.  So we're building a new name comprising the letters "pho " and the last three characters of the current filename.



Quote from: mbbphoto
How do you have it recognize spaces?

I'm not sure what you're asking.  To the substring extraction feature, a space is just like any other character.  What is it that you're trying to accomplish?

-Kirk


This is a great breakdown, thanks.


If you remove the last 3 characters does that include the suffix?

No, since {filenamebase} does not include the filename extension.  If you want the entire filename with the extension, you would use {filename} instead.

Quote from: mbbphoto
As far as the spaces go its more about INSERTING spaces (not so much in a file name but more often in Captions, the software seems to ignore spaces, carriage returns etc)

Where?  How so?

-Kirk