Rename function - experts needed

Discussion of bugs and problems found in Altap Salamander. In your reports, please be as descriptive as possible, and report one incident per report. Do not post crash reports here, send us the generated bug report by email instead, please.
Tim
Posts: 46
Joined: 28 Jan 2006, 13:28
Location: Berlin

Rename function - experts needed

Post 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

:)
User avatar
Ether
Posts: 1471
Joined: 10 May 2007, 16:08
Location: Czech Republic
Contact:

Re: Rename function - experts needed

Post 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
Attachments
renamer-regexp.png
renamer-regexp.png (24.47 KiB) Viewed 3620 times
Ελληνικά rulez.
Tim
Posts: 46
Joined: 28 Jan 2006, 13:28
Location: Berlin

Re: Rename function - experts needed

Post 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
Post Reply