You are not logged in.
Pages: 1
Hi! first of all... sorry for my bad english!
I want to remove the track numbers from the beginning of the filenames:
From...
08. Madonna - Like A Prayer.wma
08.-Madonna - Like A Prayer.wma
08 Madonna - Like A Prayer.wma
To..
Madonna - Like A Prayer.wma
The problem is that if I add a rule that remove "08"... then some songs like "Cascada - Cheri lady 2008 (Extended Bootleg Mix).mp3"
...would change to "Cascada - Cheri lady 20 (Extended Bootleg Mix).mp3"... and I don't want that.
And I don't want to use the DELETE function because I have other files that don't begin with the track number.
Is there any RegEx or Pascal script that removes numbers(+ some additional symbols like ".", "-", spaces..) FROM THE BEGINNING of the file?
Or maybe remove "08".. only if there aren't more digits on both sides.
Thanks!!!...and thanks for this program! is the best renamer I have used.
Last edited by ffff1111 (2008-02-23 04:05)
Offline
RegEx rule:
Expression: ^\d\d[- .]+(.+)
Replace: $1
Which means:
^ - start of the text/filename
\d - any digit
[-. ]+ - any of chars "-", " ", "." repeated no matter how many times
(.+) - the rest of the filename
$1 - the part of filename which was in brackets () in regex. (so anything that match "(.+)" )
I suggest reading UserManual that is added to newest versions of ReNamer. Especially part named "Regular Expression".
Best regards,
Konrad
Regular Expressions are not as hard to understand as you may think. Check ReNamer's manual or nice Regular Expressions tutorial for more info and start to use full power of applications that use them (like ReNamer, Mp3Tag and so on).
Offline
Good man, krtek
Here is a slightly improved expression: \A[\d\-\.\s]+(.+) and replace with $1
This will remove digits, dash, dot and space at the beginning of the filename, and it can be any number of digits.
So for all names like:
008. Madonna - Like A Prayer.wma
08 Madonna - Like A Prayer.wma
08. Madonna - Like A Prayer.wma
08.-Madonna - Like A Prayer.wma
Madonna - Like A Prayer.wma
You will get the same output:
Madonna - Like A Prayer.wma
Offline
You're right Denis.
It's better way to put \d into square brackets, as this notation is independent of number of digits in the beginning of the filename.
In my notation expression would be: ^[\d\s.-]+(.+)
So: \A is the same for ^
\s - is any of white signs (space, tab etc.)
In Denis's notation "\" is escape sign for any significant signs in regex (such as "." and "-"). But as long as "." sign is in square brackets it doesn't
have to be escaped. The same is about "-" sign IF it's first or last sign in square brackets. And about "^" sign IF it's NOT first sign in square brackets.
Cheers
Regular Expressions are not as hard to understand as you may think. Check ReNamer's manual or nice Regular Expressions tutorial for more info and start to use full power of applications that use them (like ReNamer, Mp3Tag and so on).
Offline
Thanks a lot guys!
It works perfectly!
Offline
Pages: 1