How do I sort files in BRU the same way as Windows 11?

Bulk Rename Utility How-To's

How do I sort files in BRU the same way as Windows 11?

Postby Jose7822 » Wed Dec 25, 2024 2:36 pm

Hi guys!

I’m new to BRU, but I’ve been searching for a solution online to no avail. I have thousands of files that need renaming from a list, but given the sheer number of files (over 6,000 at this point), it’s just easier (at least for me) to rename them with the command line prompt. The problem I’m having with BRU is that the files are not arranged the same way as they are in Windows, which makes it extremely hard to proceed because that messes up the renaming process in CMD. Here’s what they should look like:


????????? 1.wav ????? ? - 01.wav
????????? 3.wav ????? ? - 02.wav
????????? 4.wav ????? ? - 03.wav
????????? 7.wav ????? ? - 04.wav
????????? 10.wav ????? ? - 05.wav
????????? 13.wav ????? ? - 06.wav
????????? 16.wav ????? ? - 07.wav
????????? 16-01.wav ????? ? - 08.wav
????????? 18.wav ????? ? - 09.wav
????????? 19.wav ????? ? - 10.wav
????????? 1.wav ????? ? - 01.wav
????????? 3.wav ????? ? - 02.wav
????????? 4.wav ????? ? - 03.wav
????????? 5.wav ????? ? - 04.wav
????????? 6.wav ????? ? - 05.wav
????????? 7.wav ????? ? - 06.wav
????????? 9.wav ????? ? - 07.wav
????????? 11.wav ????? ? - 08.wav
????????? 13.wav ????? ? - 09.wav
????????? 14.wav ????? ? - 10.wav
????????? 16.wav ????? ? - 11.wav
????????? 17.wav ????? ? - 12.wav

The column on the left are the original files names, arranged the way Windows correctly arranges them (from lowest to highest). In BRU, Disabling “Logical Sorting” works best, but it still not good since it sorts them in this order instead:

????????? 1.wav ????? ? - 01.wav
????????? 10.wav ????? ? - 02.wav
????????? 13.wav. ????? ? - 03.wav
????????? 16-01.wav ????? ? - 04.wav
????????? 16.wav ????? ? - 05.wav
????????? 18.wav. ????? ? - 06.wav
????????? 19.wav ????? ? - 07.wav
????????? 3.wav ????? ? - 08.wav
????????? 4.wav ????? ? - 09.wav
????????? 7.wav ????? ? - 10.wav
????????? 1.wav ????? ? - 01.wav
????????? 11.wav ????? ? - 02.wav
????????? 13.wav ????? ? - 03.wav
????????? 14.wav ????? ? - 04.wav
????????? 16.wav ????? ? - 05.wav
????????? 17.wav ????? ? - 06.wav
????????? 3.wav ????? ? - 07.wav
????????? 4.wav ????? ? - 08.wav
????????? 5.wav ????? ? - 09.wav
????????? 6.wav ????? ? - 10.wav
????????? 7.wav ????? ? - 11.wav
????????? 9.wav ????? ? - 12.wav


As you can see, now the files on the left column are completely out of order, so they don’t match well with the re-numbering that I’d like to apply from the right column. Hopefully I’m explaining myself well. As mentioned, I already tried enabling/disabling “Logical Sorting” and it seems to work best with it disabled in this case, due to the prefix numbers. Otherwise those numbers really end up all over the place.

One thing to keep in mind is that, in the above case, the naming is not that different, but there are cases where they are almost completely different, which is why I need to be able to apply the list of new names (right column) to the left one. The left column needs to be in the correct order for everything to match.

BTW, I did try creating a pair list to import into BRU, but it was WAY too time consuming to make sure that there were no spaces between the names, and only having a comma there. Also, for some reason, even the little bit I created did not work for me. I saved it as an UTF-8 file, did a test, but it didn’t work.

Anyway, your help will be much appreciated. The closest I got to getting them to line up correctly was applying this RegEx:

Match: (.*)(\D)(\d)$
Replace: \1\20\3

However, I don’t know how to deal with cases like this one ????????? 16-01.wav. If you guys can help me figure that out, I think I’ll be able to organize these files in the correct way for me to apply the new names.

Thanks ????.
Jose7822
 
Posts: 8
Joined: Wed Dec 25, 2024 1:36 pm

Re: How do I sort files in BRU the same way as Windows 11?

Postby Jose7822 » Wed Dec 25, 2024 2:39 pm

The forum removed the characters that were supposed to be there, and replaced them with ???. I’m sure you’ll still get the idea :-).
Jose7822
 
Posts: 8
Joined: Wed Dec 25, 2024 1:36 pm

Re: How do I sort files in BRU the same way as Windows 11?

Postby therube » Fri Dec 27, 2024 9:07 pm

I’m sure you’ll still get the idea

Actually, no.

the files are not arranged the same way as they are in Windows

How are they arranged in Windows?

I'm good with the first set of 1..19 (& aside from 16-01).
But then what happens with the next set of files; 1..17?

And are you wanting to remove the ???'s & only have "##.wav"?
(Which kind of doesn't make sense cause it looks like you'll then end up with dup'd names?)

Code: Select all
????????? 1.wav ????? ? - 01.wav   ????????? 1.wav ????? ? - 01.wav
????????? 3.wav ????? ? - 02.wav   ????????? 10.wav ????? ? - 02.wav
????????? 4.wav ????? ? - 03.wav   ????????? 13.wav. ????? ? - 03.wav
????????? 7.wav ????? ? - 04.wav   ????????? 16-01.wav ????? ? - 04.wav
????????? 10.wav ????? ? - 05.wav   ????????? 16.wav ????? ? - 05.wav
????????? 13.wav ????? ? - 06.wav   ????????? 18.wav. ????? ? - 06.wav
????????? 16.wav ????? ? - 07.wav   ????????? 19.wav ????? ? - 07.wav
????????? 16-01.wav ????? ? - 08.wav   ????????? 3.wav ????? ? - 08.wav
????????? 18.wav ????? ? - 09.wav   ????????? 4.wav ????? ? - 09.wav
????????? 19.wav ????? ? - 10.wav   ????????? 7.wav ????? ? - 10.wav
????????? 1.wav ????? ? - 01.wav   ????????? 1.wav ????? ? - 01.wav
????????? 3.wav ????? ? - 02.wav   ????????? 11.wav ????? ? - 02.wav
????????? 4.wav ????? ? - 03.wav   ????????? 13.wav ????? ? - 03.wav
????????? 5.wav ????? ? - 04.wav   ????????? 14.wav ????? ? - 04.wav
????????? 6.wav ????? ? - 05.wav   ????????? 16.wav ????? ? - 05.wav
????????? 7.wav ????? ? - 06.wav   ????????? 17.wav ????? ? - 06.wav
????????? 9.wav ????? ? - 07.wav   ????????? 3.wav ????? ? - 07.wav
????????? 11.wav ????? ? - 08.wav   ????????? 4.wav ????? ? - 08.wav
????????? 13.wav ????? ? - 09.wav   ????????? 5.wav ????? ? - 09.wav
????????? 14.wav ????? ? - 10.wav   ????????? 6.wav ????? ? - 10.wav
????????? 16.wav ????? ? - 11.wav   ????????? 7.wav ????? ? - 11.wav
????????? 17.wav ????? ? - 12.wav   ????????? 9.wav ????? ? - 12.wav


If logical sort isn't doing it, then I'd think it is the question marks (which we're not seeing) that is affecting things?
therube
 
Posts: 1429
Joined: Mon Jan 18, 2016 6:23 pm

Re: How do I sort files in BRU the same way as Windows 11?

Postby Jose7822 » Sat Dec 28, 2024 1:29 am

therube wrote:
I’m sure you’ll still get the idea

Actually, no.

the files are not arranged the same way as they are in Windows

How are they arranged in Windows?

I'm good with the first set of 1..19 (& aside from 16-01).
But then what happens with the next set of files; 1..17?

And are you wanting to remove the ???'s & only have "##.wav"?
(Which kind of doesn't make sense cause it looks like you'll then end up with dup'd names?)

Code: Select all
????????? 1.wav ????? ? - 01.wav   ????????? 1.wav ????? ? - 01.wav
????????? 3.wav ????? ? - 02.wav   ????????? 10.wav ????? ? - 02.wav
????????? 4.wav ????? ? - 03.wav   ????????? 13.wav. ????? ? - 03.wav
????????? 7.wav ????? ? - 04.wav   ????????? 16-01.wav ????? ? - 04.wav
????????? 10.wav ????? ? - 05.wav   ????????? 16.wav ????? ? - 05.wav
????????? 13.wav ????? ? - 06.wav   ????????? 18.wav. ????? ? - 06.wav
????????? 16.wav ????? ? - 07.wav   ????????? 19.wav ????? ? - 07.wav
????????? 16-01.wav ????? ? - 08.wav   ????????? 3.wav ????? ? - 08.wav
????????? 18.wav ????? ? - 09.wav   ????????? 4.wav ????? ? - 09.wav
????????? 19.wav ????? ? - 10.wav   ????????? 7.wav ????? ? - 10.wav
????????? 1.wav ????? ? - 01.wav   ????????? 1.wav ????? ? - 01.wav
????????? 3.wav ????? ? - 02.wav   ????????? 11.wav ????? ? - 02.wav
????????? 4.wav ????? ? - 03.wav   ????????? 13.wav ????? ? - 03.wav
????????? 5.wav ????? ? - 04.wav   ????????? 14.wav ????? ? - 04.wav
????????? 6.wav ????? ? - 05.wav   ????????? 16.wav ????? ? - 05.wav
????????? 7.wav ????? ? - 06.wav   ????????? 17.wav ????? ? - 06.wav
????????? 9.wav ????? ? - 07.wav   ????????? 3.wav ????? ? - 07.wav
????????? 11.wav ????? ? - 08.wav   ????????? 4.wav ????? ? - 08.wav
????????? 13.wav ????? ? - 09.wav   ????????? 5.wav ????? ? - 09.wav
????????? 14.wav ????? ? - 10.wav   ????????? 6.wav ????? ? - 10.wav
????????? 16.wav ????? ? - 11.wav   ????????? 7.wav ????? ? - 11.wav
????????? 17.wav ????? ? - 12.wav   ????????? 9.wav ????? ? - 12.wav


If logical sort isn't doing it, then I'd think it is the question marks (which we're not seeing) that is affecting things?



The ??? parts came out that way because I guess the forum doesn’t recognize Kanji characters, but you can replace them with whatever you want. For example:

Audio File 1.wav
Audio File 3.wav
Audio File 4.wav
Audio File 7.wav
Audio File 10.wav
Audio File 13.wav
Audio File 16.wav
Audio File 16-01.wav

Etc.

Honestly, the main issue are files named “Audio File 16-01.wav”, for example. There’s a lot of them like that, which makes the renaming difficult due to repeated names, as you mentioned. I can fix the other files by adding a “0” on single digit numbers. That’s actually not bad.

Anyway, is there a way around that?

I don’t understand why Windows is able to organize these files in the order shown, but BRU can’t.
Jose7822
 
Posts: 8
Joined: Wed Dec 25, 2024 1:36 pm

Sort files like Windows

Postby Luuk » Sat Dec 28, 2024 4:47 am

Greetings Jose, this is not a solution but it might help to fix the sorting.
It does depend on a space being before the numbers at the end, like in the samples.
It should probably also depend on using the "Logical Sorting" option also...

With RegEx(1) having the 'v2' checkmark, the "Match" and "Replace" could be like...
( )(\d+-)(\d+)$(?X)( )(\d+)$(?X):0*(?=\d{3,})/g
$1:000$2:000$2(?X)$1:000$2-:000(?X)

This will pad the New-Name column to look like...
AudioFile 1 ----> AudioFile 001-000
AudioFile 3 ----> AudioFile 003-000
AudioFile 9-1 --> AudioFile 009-001
AudioFile 9 ----> AudioFile 009-000
(It only pads numbers at the end, like in your samples)

Then you could click the New-Name column for resorting filenames more like in Windows.
Then just remove the checkbox for RegEx(1) to rename them however you're deciding.
Luuk
 
Posts: 809
Joined: Fri Feb 21, 2020 10:58 pm

Re: How do I sort files in BRU the same way as Windows 11?

Postby Admin » Sat Dec 28, 2024 5:26 am

Hi Jose7822,
are you using Logical Sorting in BRU?
The option is in Display Options -> Sorting.
Admin
Site Admin
 
Posts: 2923
Joined: Tue Mar 08, 2005 8:39 pm

Re: Sort files like Windows

Postby Jose7822 » Sat Dec 28, 2024 3:58 pm

Luuk wrote:Greetings Jose, this is not a solution but it might help to fix the sorting.
It does depend on a space being before the numbers at the end, like in the samples.
It should probably also depend on using the "Logical Sorting" option also...

With RegEx(1) having the 'v2' checkmark, the "Match" and "Replace" could be like...
( )(\d+-)(\d+)$(?X)( )(\d+)$(?X):0*(?=\d{3,})/g
$1:000$2:000$2(?X)$1:000$2-:000(?X)

This will pad the New-Name column to look like...
AudioFile 1 ----> AudioFile 001-000
AudioFile 3 ----> AudioFile 003-000
AudioFile 9-1 --> AudioFile 009-001
AudioFile 9 ----> AudioFile 009-000
(It only pads numbers at the end, like in your samples)

Then you could click the New-Name column for resorting filenames more like in Windows.
Then just remove the checkbox for RegEx(1) to rename them however you're deciding.


You are a genius!!

This is the solution I was looking for. Thank you!!!

I simply needed the files to display in order (the same order that Windows displays them) and this accomplishes that. That way I can use a list of names to rename the files whatever I want. I know that BRU has this function (rename files from a list), but I honestly find it much easier to do this using the command prompt (via the Excel spread sheet trick). The way I was going about this before was taking too long since I was using the Windows rename function, which required me to rename each list with the "AudioFile 16-01" numbering individually. Then go into BRU to pad single digit numbers at the end with a "0" using the RegEx formula I posted in my OP, just to make them line up. A PITA to say the least.

Anyway, thank you so much for providing that RegEx formula. You've saved me hours of renaming files still ahead of me.
Jose7822
 
Posts: 8
Joined: Wed Dec 25, 2024 1:36 pm

Re: How do I sort files in BRU the same way as Windows 11?

Postby Jose7822 » Sat Dec 28, 2024 4:06 pm

Admin wrote:Hi Jose7822,
are you using Logical Sorting in BRU?
The option is in Display Options -> Sorting.


I tried that, but in this case disabling "Logical Sorting" was better.

The reason why is because I forgot to mention that these files also have numbers on the left, so they should be something like:

01 Audio File 5
01 Audio File 8
01 Audio File 9-01
02 Audio File 1
02 Audio File 2
02 Audio File 3

ETC.

If I enable "Logical Sorting" then the numbers on the right sort of line up (I say "sort of" because those with the 0-01 still end up in the wrong position), but the numbers on the left get all jumbled up. Again, why isn't there an option to sort files the way Windows 11 sorts them? This shouldn't be hard to implement, I would assume (but I might be wrong).
Jose7822
 
Posts: 8
Joined: Wed Dec 25, 2024 1:36 pm

Re: How do I sort files in BRU the same way as Windows 11?

Postby Admin » Wed Jan 08, 2025 6:40 am

In the latest version we have improved drad and drop functionality and added a new command to file explorer "Bulk Rename Selected Items".

Drag and Drop

Note that any files/folders you drag on the window will be added at the bottom of the list of files/folders already there.
If you instead wish to show ONLY the items you are dragging, then simply hold down the CTRL key while dragging.

If you want all dragged items to be automatically selected for renaming, enable the option List -> AutoSelect All Items After Drag and Drop in the Actions Menu.

Maintaining Item Order: When selecting multiple items, if you want to preserve their order in Bulk Rename Utility,
make sure you start dragging from the first item after selecting all the desired files (this is a Windows feature).

_autoload.bru file: This is a special file that is automatically loaded when using 'Drag and Drop' or Bulk Rename Here,
provided the file exists in the same folder as the selected files. This allows you to have different .bru files automatically loaded in different folders

Bulk Rename Here

This command can be used on multiple files or a folder. It will open Bulk Rename Utility with the selected files
and the parent folder fully scanned. Files might be resorted according to the sorting options within Bulk
Rename Utility. If a favourite file (.bru) was recently used, it will be automatically loaded.

Bulk Rename Selected Items

This command can also be used on multiple files or a folder. It will open Bulk Rename Utility with only the
selected files, preserving the same order as in Windows File Explorer. If a favourite file (.bru) was recently
used, it will be automatically loaded.

Note: You can select up to a maximum of fifty thousand items at one time.
Admin
Site Admin
 
Posts: 2923
Joined: Tue Mar 08, 2005 8:39 pm

Re: How do I sort files in BRU the same way as Windows 11?

Postby Jose7822 » Tue Jan 28, 2025 9:47 am

Admin wrote:In the latest version we have improved drad and drop functionality and added a new command to file explorer "Bulk Rename Selected Items".

Drag and Drop

Note that any files/folders you drag on the window will be added at the bottom of the list of files/folders already there.
If you instead wish to show ONLY the items you are dragging, then simply hold down the CTRL key while dragging.

If you want all dragged items to be automatically selected for renaming, enable the option List -> AutoSelect All Items After Drag and Drop in the Actions Menu.

Maintaining Item Order: When selecting multiple items, if you want to preserve their order in Bulk Rename Utility,
make sure you start dragging from the first item after selecting all the desired files (this is a Windows feature).

_autoload.bru file: This is a special file that is automatically loaded when using 'Drag and Drop' or Bulk Rename Here,
provided the file exists in the same folder as the selected files. This allows you to have different .bru files automatically loaded in different folders

Bulk Rename Here

This command can be used on multiple files or a folder. It will open Bulk Rename Utility with the selected files
and the parent folder fully scanned. Files might be resorted according to the sorting options within Bulk
Rename Utility. If a favourite file (.bru) was recently used, it will be automatically loaded.

Bulk Rename Selected Items

This command can also be used on multiple files or a folder. It will open Bulk Rename Utility with only the
selected files, preserving the same order as in Windows File Explorer. If a favourite file (.bru) was recently
used, it will be automatically loaded.

Note: You can select up to a maximum of fifty thousand items at one time.


Apologies for the late reply. I wanted to come here soon after your post, but I was very busy with the same project that sparked this thread.

But, “THANK YOU!” for this amazing update.

BRU now sorts files the same way as Windows 11 does, which is SUPER convenient. I don’t have to prep the files just so that they appear in the correct order anymore. Also, thank you for all the other improvements . They’re awesome! ????

Please keep up the great work!!
Jose7822
 
Posts: 8
Joined: Wed Dec 25, 2024 1:36 pm


Return to How-To