Page 1 of 1

How to remove numbers, characters from beginning file names

PostPosted: Wed Feb 24, 2021 2:53 pm
by Flourgrader
Hi All,
I have BRU on a Windows 10 PC
Can someone give me some advice in how to rename
37,000 music files I have?
I want to remove the track number at the beginning of each of the songs and any other characters which have been added including empty space.
The length of the string of characters at the begging is not consistent in length.
Which in my mind makes it harder to do?
I have given a few examples below in what I mean.
There are obviously too many songs to do it one by one!
99_madonna vogue.mp3
1. madonna vogue.mp3
1_ madonna vogue.mp3
10- madonna vogue.mp3
--- madonna vogue.mp3
I want it to look like this “madonna_vogue.mp3”
Thank You.

Re: How to remove numbers, characters from the beginning of a fi

PostPosted: Wed Feb 24, 2021 5:19 pm
by therube
I'd start small... take it in steps... A start...

1:RegEx
Code: Select all
Match:  (^[^a-zA-Z]+)(.*)
Replace:  \2

That says to disregard any starting characters that are not alpha characters (& keep the rest).

Do note that that will fail on a song like:
Code: Select all
10 Years After - I'd Love To Change The World.mp3

changing it to:
Code: Select all
Years After - I'd Love To Change The World.mp3

Re: How to remove numbers, characters from the beginning of a fi

PostPosted: Wed Feb 24, 2021 8:50 pm
by Flourgrader
Thanks for the advice,I did appreciate it.

Re: How to remove numbers, characters from beginning file names

PostPosted: Sat Mar 13, 2021 1:14 am
by rtoledo2002
I hope someone gets a laugh out of my situation as i do.

I found this wonderful program back when it was version 2.7 I quickly figured out how to use it to remove the 2 numbers at the begining of my 130 gigs of music files.

Then later I updated to 3.0 and donated cause I found , that using it just once saved me tons of hours. fast forward to today , I lost the " clean " directory and had to goback to back ups in my Synology NAS. my memory has been going away lately 63 years old( Alhzheimer's runs in my family ) anyway , I came to this forum to figure out what I had figured out a couple of years back and the example in this thread is giving me some weird results with ADDED numbers ? I took a screen capture so you can see what I'm doing and how it should be done correctly.


Image

Re: How to remove numbers, characters from beginning file names

PostPosted: Sat Mar 13, 2021 1:23 am
by rtoledo2002

Re: How to remove numbers, characters from beginning file names

PostPosted: Sat Mar 13, 2021 1:29 am
by rtoledo2002
Image

Re: How to remove numbers, characters from beginning file names

PostPosted: Sat Mar 13, 2021 3:14 am
by Luuk
Greetings, Im no ideas what you like for the new names, but ...
RegEx(1) removes all beginning chars that arent a-z or A-Z, because theres no \1 inside the "Replace".
Numbering(10) is then prefixing the numbers.

Re: How to remove numbers, characters from beginning file names

PostPosted: Sun Mar 14, 2021 1:17 am
by rtoledo2002
Luuk wrote:Greetings, Im no ideas what you like for the new names, but ...
RegEx(1) removes all beginning chars that arent a-z or A-Z, because theres no \1 inside the "Replace".
Numbering(10) is then prefixing the numbers.


THANK YOU FOR REPLYING on the picture above the first song starts with 01 - Randy Travis . I would like to remove the 01 - . I would prefer to first remove all the 2 digit numbers and then do a second pass and remove the -

Hope this explains it better, hope someone has ideas .

thanks again

Remove first 2 numbers from beginning

PostPosted: Sun Mar 14, 2021 9:38 am
by Luuk
The Regex(1) can do this in first pass, with the "Match" and "Replace" like ...
^\d\d[ -]+(.*)
\1
The ^\d\d[ -]+ is saying "Beginning two numbers, followed by one-or-more "space" or "-".
Then (.*) is saying "(everything else)", so \1 using (.*) as the new name, renaming like...

12 --- filename.txt ===> filename.txt
12-filename.txt =====> filename.txt
12 filename.txt =====> filename.txt
122 - filename.txt ===> (no rename, because three numbers)
123filename ========> (no rename, because three numbers and no "space" or "-")
12filename.txt ======> (no rename, because no "space" or "-" after "beginning two numbers")

=========================================================================

If also wanting to rename the last example?? Im recommend using this instead..
^\d\d[ -]*([^\d].*)
\1
The ^\d\d[ -]* is saying "Beginning two numbers, followed by zero-or-more "space" or "-".
Then ([^\d].*) is saying "(Not a number, everything else), so \1 using this as the new name.

It also renames the last example, so always removing... "First two numbers" (if not a third number) and any following "space" or "-".
If the solutions cannot help for all of the filenames, then need more examples so maybe there can be another regex to better conduct all of the examples.
Also Im thinking its safer with "Renaming Options, Prevent Duplicates" in case you have any exact same filenames, but with different "Beginning two numbers".