Page 1 of 1

Rename function - experts needed

Posted: 18 Dec 2009, 09:39
by Tim
Dear Community,

Is there a way to use the Rename function in the following way?

I want to do a pretty easy search and replace action (replace "colon" with "colon and space").
So far no problems.

Example:

[OLD FILENAME]
Doyle,A C_A Study in Scarlet, Part 1_BBC_1989.mp3

[OLD FILENAME]
Doyle, A C_A Study in Scarlet, Part 1_BBC_1989.mp3


Now here's the hard part: I wish to limit this action to the file name segment before the first underscore.
I need to avoid the following scenario (where 2 spaces are created if the author's name does not include a colon):
In this case, even the option "Only once in each name" does not help.

[OLD FILENAME]
Doyle_A Study in Scarlet, Part 1_BBC_1989.mp3

[OLD FILENAME]
Doyle_A Study in Scarlet, Part 1_BBC_1989.mp3


Can I set an underscore as an end point for a S&R operation?


Thanks for any help
Tim

:)

Re: Rename function - experts needed

Posted: 18 Dec 2009, 09:57
by Ether
Tim wrote:Can I set an underscore as an end point for a S&R operation?
Yes, you can do that, but I think it would suffice to create a regexp that wouldn't add a space when there already is one. Use:

Search for: , ? (comma, space, question mark)
Replace with: , (comma, space)
[ ] Only once in each name
[x] Regular expression

Re: Rename function - experts needed

Posted: 18 Dec 2009, 10:19
by Tim
Efharisto, ether!
Mind-boggling.
Your approach is much smoother.
I really should study regexp's!

Once again, thank you very much indeed.

Cheers
Tim