Renaming a non-consistent part of a filename

Post any Bulk Rename Utility support requirements here. Open to all registered users.

Renaming a non-consistent part of a filename

Postby rhino » Mon Dec 29, 2008 4:35 pm

Hi all,

Sincere apologies if this is addressed elsewhere. I couldn't find anything via a search.

I have several folders, the files of which I want to rename. They are all in the following format:

01 - artistname1 - songtitle.mp3
02 - artistname2 - songtitle.mp3
03 - artistname3 - songtitle.mp3

and so on.

The problem is that the artistname and songtitle fields are not consistent.

What I want to do is find a way of deleting "space" "dash" "space" "artistname" "space" - I'm simply not clever enough to work out how to do it :(

Regards,

Mike
rhino
 
Posts: 2
Joined: Mon Dec 29, 2008 4:29 pm

Re: Renaming a non-consistent part of a filename

Postby jimwillsher » Mon Dec 29, 2008 4:40 pm

Hi,

You can probably use a regular expression. I've not tried it, but I imagine something like this would work:

Match: (.*)(\s-\s)(.*)
Replace: \3


Jim
jimwillsher
 
Posts: 63
Joined: Wed Sep 24, 2008 1:22 pm

Re: Renaming a non-consistent part of a filename

Postby rhino » Mon Dec 29, 2008 4:56 pm

Hi Jim,

Thanks for a super-fast response. I'm rather ashamed to say that the whole regular expression thing had me totally baffled.

What your formula does is take out the number and the artistname - and from that, of course, it's a simple task to renumber. Thank you.

Regards,

Mike

Edit:

(.*)(\s-\s)(.*)(\s-\s)(.*)
\1 - \5

Seems to do what I want. I have no idea what any of it means but thank you again :)
rhino
 
Posts: 2
Joined: Mon Dec 29, 2008 4:29 pm


Return to BRU Support