Page 1 of 1

Rename everything before a specific character

Posted: 04 Jul 2010 22:39
by lostinthe60s
Hi all, new to this browser, but I really like it. The answer to my question is prolly in here somewhere, but I have'nt found it. I have about 3500 .mp3 files. The file names for each .mp3 file is
Artist-song .mp3. Like
Bob Dylan-Blowing in the Wind.mp3
I want to remove the Artist from each filename. I need something like
Rename everything before - to (space)
I follow the concept, and can do 30 Bob Dylan files just fine. But 1 Bob Dylan and 1 Blackfoot I can't do I have tried a couple of ways, but no luck. For instance
*- >
with a (space) behind the separator. Basically I need a way to define several groups of characters in which no group has anything in common with another group except that ALL groups preceed a - Any help will be greatly appreciated.

Re: Rename everything before a specific character

Posted: 04 Jul 2010 23:35
by Stefan
lostinthe60s wrote:Hi all, new to this browser, but I really like it. The answer to my question is prolly in here somewhere, but I have'nt found it. I have about 3500 .mp3 files. The file names for each .mp3 file is
Artist-song .mp3. Like
Bob Dylan-Blowing in the Wind.mp3
I want to remove the Artist from each filename. I need something like
Rename everything before - to (space)
I follow the concept, and can do 30 Bob Dylan files just fine. But 1 Bob Dylan and 1 Blackfoot I can't do I have tried a couple of ways, but no luck. For instance
*- >
with a (space) behind the separator. Basically I need a way to define several groups of characters in which no group has anything in common with another group except that ALL groups preceed a - Any help will be greatly appreciated.
Hi lost, welcome.

You can do this by an regular expression rename action.

The issue:
Search anything till one-or_none-space, followed by an dash, followed by one-or_none-space

RegEx explanation:
Search one-or-more of anything => ".+"
none,one or more-space => "\s*"
an dash => "-"
none,one or more-space => "\s*"
anything, grouped for reuse by $1 => "(.+)"

The expression to use:
.+\s*-\s*(.+) > $1

Re: Rename everything before a specific character

Posted: 05 Jul 2010 02:17
by lostinthe60s
Stefan,
Thank you so much for the help...worked like a charm. I assume there is a tutorial for this somewhere. I am going to look for it, but in case I don't find it, could you post a link to it for me. I must say, until I got XYplorer I never realized what a tool a file browser could be. I'm gonna have fun with this. And, again, I appreciate the help.