Batch delete & move text around in Windows

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

Batch delete & move text around in Windows

Postby dtw5 » Fri Jul 12, 2013 11:45 am

Batch delete & move text around in Windows
Hello new boy here.

I have searched on this forum but not been able to recognise what I am looking for. I bet it’s there but I can’t see it, sorry.

Basically I need to batch delete numbers and move some text around in Windows file names. I can’t find a software way of doing this with music taggers or rippers (anyone know?) so it looks like I will need to use Windows.

I’m ripping CDs to flac files. I can see the files in the CD folders using Windows Explorer with a standard Windows 7 laptop. At the moment I don’t want to do anything with the music or any tags that are referred to in point 7. below, it is just the file names.

Ordinarily the music tracks can stay in their CD/album format but when it comes to Singles that just happen to be on random compilation CDs, that won’t work. There are many with 4 or 5 instances of the same track but pre-selecting the wanted tracks and ripping only those would be far too mind-blowing.

So, getting all the tracks together into alphabetical order (ideally by song title) would make it easier for me to identify the unwanted tracks and delete them. But, as you would expect, the track file names show the track numbers e.g. 05_Buddy_Holly_-_That'll_Be_The_Day.flac.

The least I need to do is batch delete ALL the number prefixes like 05_ or 5, up to about 30 per CD but what would be even better would be to invert the file names so they show the song title first e.g. That'll_Be_The_Day_-_Buddy_Holly.flac, (I’ve placed ‘_-_’ between artist and song but that’s not essential).

As far as I understand it, none of these changes affect how the music is viewed on the player.

Here’s how I see it being worked:
1. Rip the umpteen CDs in full with the tracks all auto-identified like the example above.

2. Move all the resulting music files from their ‘CD’ folder to a single Window’s folder.

3. Remove the track number pre-fixes (01_, 02_ or 1, 2 etc.) and if possible change the file names so that the titles appear at the beginning.

4. Use Sort in Windows folders so that the tracks fall into alphabetical order by artist or better still by song title.

5. Delete all repeats (except versions by other artists) now grouped together.

6. Select the remaining flac files and place these in folders called: Singles A to F, Singles G to L, etc. with about 25 tracks on each (or one giant ‘album’ with all the singles on it).

7. Use something to name/tag the final collection/s so they are identified with their new ‘albums’ (using dBpoweramp or mp3tag?) rather than their original CDs and are number-tag them in their new play-order. The players will still ‘see’ the artist and hopefully the tracks will be searchable.

8. Move the results back to the music store.

Sorry this is such long post but I have tried to make it so I’m not wasting your time with half a story. Even so I bet I have forgotten something obvious. I really hope you can help with steps 3 and 4 and if there’s a genius out there who knows about the other stuff, that would be great.

Do you think Bulk Rename Utility can help with this and if yes, what steps should I take? The codes and formula look a bit daunting.

Thanks,
Dave
dtw5
 
Posts: 2
Joined: Fri Jul 12, 2013 10:19 am

Re: Batch delete & move text around in Windows

Postby truth » Sun Jul 21, 2013 4:47 am

Sorry, never used any kind of ripping/tagging software, so I cant help you there.
I am assuming that your 'ripping' app creates one directory for each CD copied?

I only ask in case those directories also represent your 'music-store' (irrelevant otherwise).
In that case, since some redundantly-created singles could have the exact same filename,
it would be important to check Windows Explorer's Move&Replace feature for those files.
Otherwise, your 'music-store' directories could still have some singles that never got moved.

I'm not sure why you need to 1st move .flac's into one folder, but regardless once they're there,
BRU can delete the rest of your redundantly-created singles (the ones with different leading ##)
The renaming part is easy, but I need to verify some filename conditions:
1. Are filenames always: ##_Artist Name_-_Song Name.flac
2. Is there always at least one leading #, and never more than three?
3. Is ## always followed by either space or underscore?
4. What are the separators inbetween Artist and Song: _-_? Space-Space? any-others?
5. Are there ever multiple dashes within filename

Since you plan on 1st moving files into 1 folder, and having redundantly-created singles:
The below will delete your redundants and change ## Artist - Song.flac --> Song - Artist.flac

Conditions: Filenames must begin with 1-3 #s (followed by space/underscore) before Artist
Artist and Song must be separated by either _-_ or space-space
Filenames must not have more than one dash
If any filename doesnt meet all of those conditions, it wont be renamed
Post back with more details if you need another solution, otherwise use:

Settings:
Options/OverwriteTargetFiles=Checked
Options/PreventDuplicates=Checked
Options/Ignore/FileExtensions=UnChecked

1RegEx match/replace:
(^[0-9]{1,3}[ _])([^-]*)(_-_| - )([^-]*)$
\4\3\2

When you finish renaming everything, I would undo all of those settings
They're known trouble-makers, but actually a benefit in this particular case.
Last edited by truth on Thu Jul 25, 2013 10:10 am, edited 1 time in total.
truth
 
Posts: 221
Joined: Tue Jun 25, 2013 3:39 am
Location: Earth, OrionArm, MilkyWay

Re: Batch delete & move text around in Windows

Postby dtw5 » Sun Jul 21, 2013 2:32 pm

Very many thanks for the time you’ve obviously spent on this, and for the cautions.

To answer your queries:

a. Correct, there’s only one copy of the music created that can be worked with, so those ‘directories’ are the 'music-store'. I could create copies and work with those (for safety’s sake) but it’d be time-consuming and unwieldy.

b. Usually single tracks (a flac file) are in a folder (per CD) and these folders can be stand-alone or in yet another folder. The idea was to get all singles (tracks) together in a single folder to achieve 4. and 5. in my original posting.

As I said I’m a new boy and I’m new to this music ripping too. As far as I know my answers are correct.
1. Yes, in the compilations that I’m dealing with but not otherwise.

2. Yes.

3. I’m pretty sure, yes.

4. I’ve only seen Artist _-_Song / Artist - Song / Artist; Song / Artist, Song and Artist Song. I think the last three will be pretty rare in the compilations I’m dealing with. I don’t know of any others, at least not with the software I’m using (VortexBox, dBpoweramp, mp3tag).

5. I haven’t noticed any and I don’t think so. I’m assuming your 3rd Condition means not having more than one dash together. Because obviously there could be lots of dashes within a Filename.

I’ve got to admit that this is all a bit intimidating for me but I hope is going to be useful. I was very surprised, given I couldn’t see why anyone would want multiple copies of the same track, that there wasn’t some point-and-shoot software available that would achieve the selection pre-rip or post-rip. There ought to have been some way that doesn’t involve cigarette packets and chewed pencils and it looks like you have got there in one go.

Brilliant and thanks again.
dtw5
 
Posts: 2
Joined: Fri Jul 12, 2013 10:19 am

Re: Batch delete & move text around in Windows

Postby truth » Thu Jul 25, 2013 10:03 am

That expression only allows 1 dash anywhere within the filename (as the separator)
Sorry, just a precaution till getting more filename conditions, is it a common occurrence?

Mutiple-dashes are no problem IF you can verify:
1A: Whenever space-space or _-_ exists, is the 1st-occurrence always the Artist/Song separator?
.....(my original expression assumed only one could exist, and therefore must be the separator)
If always true, use below 1RegEx:
(^[0-9]{1,3}[ _])(.+?)(_-_| - )(.*)$
\4\3\2

I wouldnt try to incorporate more Artist/Song separators, unless you're 100% certain of the following:
1B: When ;space is the separator, is it always the 1st ;space?
.... Artist; Name - Song would get improperly-renamed
2B: When ,space is the separator, is it always the 1st ,space?
.... Artist, Name - Song would get improperly-renamed
If either can be false, its best to catch them with a 2nd expression, and *;* or *,* in your 12Filter
If either will ALWAYS be true, post back for an easy quick-fix to the expression

Incorporating a space as the separator is highly unlikely, & risky at best!
The only method I foresaw required all ArtistNames to always have the exact same #spaces
An example question assuming all ArtistNames must have 0-spaces:
1C: When space is the seperator, is it always the 1st occurrence of AlphaSpace?
.... Yes -> 005 Madonna Song
..... No -> 005 Michael Jackson Song (separator is 2nd occurence of AlphaSpace)

I'd probably stick with the RegEx above to do my renaming, and then sort by name
Your untouched files (still starting with ##) would stand-out at the top of your screen
Its better to match too-little than too-much, especially with your settings
As long as (^[0-9]{1,3}[ _]) begins your next expression, you cant touch previously renamed files

In case you're not aware, this is how 1Regex groups work:
- - - MATCH - - - - - - - - - - - - - - - - - - REPLACE
.1st ( ) enclose text-specifiers that ..... \1 represents
2nd ( ) enclose text-specifiers that ..... \2 represents

So in your case:
... MATCH .............. REPLACE
(^[0-9]{1,3}[ _]) ....... \1 = LeadingNumbers(AtLeast1,NoMoreThan3) followed by a space or _
(.+?) ..................... \2 = AnyText (after above) until next group matches its text (Artist)
(_-_| - ) ................ \3 = Either _-_ OR space-space (separator)
(.*)$ ..................... \4 = Everything after last group (Song)

Since you want to discard leading ##s, we just omit \1 in your replace
Note you can also insert regular text anywhere within the ReplaceBox, ex:
\4 --by-- \2 would create filenames as: SongName --by-- ArtistName.flac
truth
 
Posts: 221
Joined: Tue Jun 25, 2013 3:39 am
Location: Earth, OrionArm, MilkyWay

Re: Batch delete & move text around in Windows

Postby Tomas Aylmer » Sat May 17, 2014 9:12 am

dtw5 wrote:Very many thanks for the time you’ve obviously spent on this, and for the cautions.

To answer your queries:

a. Correct, there’s only one copy of the music created that can be worked with, so those ‘directories’ are the 'music-store'. I could create copies and work with those (for safety’s sake) but it’d be time-consuming and unwieldy.

b. Usually single tracks (a flac file) are in a folder (per CD) and these folders can be stand-alone or in yet another folder. The idea was to get all singles (tracks) together in a single folder to achieve 4. and 5. in my original posting.

As I said I’m a new boy and I’m new to this music ripping too. As far as I know my answers are correct.
1. Yes, in the compilations that I’m dealing with but not otherwise.

2. Yes.

3. I’m pretty sure, yes.

4. I’ve only seen Artist _-_Song / Artist - Song / Artist; Song / Artist, Song and Artist Song. I think the last three will be pretty rare in the compilations I’m dealing with. I don’t know of any others, at least not with the software I’m using (VortexBox, dBpoweramp, mp3tag).

5. I haven’t noticed any and I don’t think so. I’m assuming your 3rd Condition means not having more than one dash together. Because obviously there could be lots of dashes within a Filename.

I’ve got to admit that this is all a bit intimidating for me but I hope is going to be useful. I was very surprised, given I couldn’t see why anyone would want multiple copies of the same track, that there wasn’t some point-and-shoot software available that would achieve the selection pre-rip or post-rip. There ought to have been some way that doesn’t involve cigarette packets and chewed pencils and it looks like you have got there in one go.

Brilliant and thanks again.

It's really appreciable. I wanna talk about this topic sometimes but I have restrictions. I hope you can highlighted this post with another way.
Tomas Aylmer
 
Posts: 1
Joined: Sat May 17, 2014 9:02 am


Return to BRU Support