#1 2009-11-12 21:09

elton
Member
Registered: 2009-10-17
Posts: 7

Help in renaming track numbers

Hello

I am trying to rename many music files and have come across a problem that hopefully someone can give me guidance on.

My files are named as follows.

'Artist' - 'Album' 'Track' 'Track Name' eg Mahavishnu Orchestra - Birds of Fire 05 Thousand Island Park

What I am trying to do is replace the Artist and Album seperator with a # and also add a # to the track track number so the renamed file becomes Mahavishnu Orchestra #Birds of Fire #05 Thousand Island Park

The first seperator is the easy part, but I am having difficulties in getting the track renamed.

I had been using the Replace rule [in a particularly long handed method] to look for 01 and change it to #01 and so on up to about 30. But what's happening is that there are many files using numbers in the Track Names that are also getting changed. eg Pink Floyd - Piper at the Gates of Dawn 09 Chapter 24 becomes [using my flawed methodology] Pink Floyd - Piper at the Gates of Dawn #09 Chapter #24

Is there a way that I can get Renamer to do this. There must be a way but I am too seriously dumb to figure it out. Any advice will be most welcome.

smile

Offline

#2 2009-11-13 02:34

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,379

Re: Help in renaming track numbers

Actually, since you have already created replace rules to prefix all 01..30 with #, you can simply use "Occurrences: First" option to affect only the first occurrence. This will fix your "#09 Chapter #24" case.

All those replace rules can be replaced with a single RegEx rule, i.e. Expression: \b(\d\d)\b Replace: #$1 -- but unfortunately RegEx rule doesn't have that "first occurrences only" option. You could then remove all but the first # characters. This is just an idea tho.

Offline

#3 2009-11-13 20:03

SafetyCar
Senior Member
Registered: 2008-04-28
Posts: 446
Website

Re: Help in renaming track numbers

den4b wrote:

Actually, since you have already created replace rules to prefix all 01..30 with #, you can simply use "Occurrences: First" option to affect only the first occurrence. This will fix your "#09 Chapter #24" case.

All those replace rules can be replaced with a single RegEx rule, i.e. Expression: \b(\d\d)\b Replace: #$1 -- but unfortunately RegEx rule doesn't have that "first occurrences only" option. You could then remove all but the first # characters. This is just an idea tho.

What about something like this?

Expression: ^(.*?\b)(\d\d)(\b.*)$
Replace:     $1#$2$3

I'm not very used to use boundaries, so I decided to include it again on the file name  roll
Are there any cases where using boundaries can remove characters?

Last edited by SafetyCar (2009-11-13 20:13)


If this software has helped you, consider getting your pro version. :)

Offline

#4 2009-11-14 11:41

elton
Member
Registered: 2009-10-17
Posts: 7

Re: Help in renaming track numbers

Thank you for the suggestions. I shall have a play today and let you know how I got on.

Offline

#5 2009-11-14 14:22

elton
Member
Registered: 2009-10-17
Posts: 7

Re: Help in renaming track numbers

Well I've had a play with circa 6,000 files.  Using SafetyCar's slightly modified expression ^(.*?\b) (\d\d )(\b.*)$ replaced with $1 #$2$3 is providing the better results. It is not 100% correct because of the naming of the files but its very close.

Now and then half the file is renamed properly, but the other half remains untouched. So using 2 instances of Renamer open at the same time, I use den4b's suggestion in the other instance and get the best of both worlds.

There are a few anomalies, but overall I am very happy. Only another circa 80,000 files to go .... and then I start on the photographs!!


Thank you very much.  big_smile


It would appear that 99% of the anomalies I mentioned have a consistency. If the track number in the file name is followed by a space then something in square brackets the file does not rename. eg

Traffic - John Barleycorn Must Die 04 [Bonus Track] I Just Want You To Know

Mmmm. Not a major issue but if there is a modified exception I'm all ears.  smile

Last edited by elton (2009-11-14 14:43)

Offline

#6 2009-11-14 15:21

SafetyCar
Senior Member
Registered: 2008-04-28
Posts: 446
Website

Re: Help in renaming track numbers

ummm, the \b (boundary) represents a change between a letter and other type of symbols, so maybe what you want to do is use the space instead of the "boundaries"

So, I think what you wanted to do is this:
Expression: ^(.*? )(\d\d)( .*)$
Replace:     $1#$2$3


If this software has helped you, consider getting your pro version. :)

Offline

#7 2009-11-14 15:28

elton
Member
Registered: 2009-10-17
Posts: 7

Re: Help in renaming track numbers

Oh, way to go SafetyCar absolutely spot on.  cool

I am very grateful.  smile

Offline

Board footer

Powered by FluxBB