subfolder dir

Bulk Rename Utility How-To's

subfolder dir

Postby Xuorel » Thu Jul 07, 2022 10:02 am


i have 2 on 1 questions :

1) May i find somewhere documentation about "Condition" filter ?

2) how can i do to search all folders with a specific path direction ?

eg :
C:\folder 1\nature 1\subfold 1\...
C:\folder 1\nature 2\subfold 2\...
C:\folder 2\nature 1\subfold 1\...
C:\folder 2\nature 2\subfold 1\...

I want to search all subfolder contained on a folder named "nature 2".

Thank you

Posts: 4
Joined: Thu Jun 23, 2022 12:12 pm

Re: subfolder dir

Postby therube » Thu Jul 07, 2022 4:27 pm

Given that you have a space in your directory name, "nature 2", I'm not sure you can do that.

If the name were "nature2", you set that in 12:Filter -> Mask:
but even that is kind of awkward.

What I would do would be to use Everything to find your files, & drag the found files into BRU.

In Everything, a search for "nature 2" (in quotes) or \nature 2\ would find your files.

Note that "nature 2" would find (files & directories):
\nature 2\, a directory path
& also "i'm going back to nature 2.TXT", a file name

You can do all kinds of things to further filter results.

folder:"nature 2", would only find folders

parents:3 "nature 2", would find "nature 2", 3 directory levels down
(parents:3 acts similar to, Lvl:1 with a starting search of C:\folder 1\)

So if you have:
C:\folder 1\nature 2\subfold 2\...
C:\nature 2\nature 999\subfold 2\...

parents:3 says to start the search 3 directory levels down
& since C:\nature 2\ is only 2 directory levels down, it would not be found.
Posts: 1100
Joined: Mon Jan 18, 2016 6:23 pm

Match files anywhere below some \folder-name\

Postby Luuk » Fri Jul 08, 2022 1:17 pm

Greetings Xuorel, if renaming with anything inside of the Filters(12) "Condition", must have the paid commercial license.
It grants using any javascript condition to match your files or folders, and page-52 in the manual presents some examples.
I can give examples, but must remember that to rename anything, it does require first having the paid commercial license!

First to click any drive or folder inside of the folder-tree, where bru should start looking beneath, for the files or folders to be tested.
Then Filters(12) needs a checkmark in "Subfolders", and then also checkmarks for "Files" and "Folders", if wanting to see both?
The "Condition" can be any javascript condition, and can use different variables like folder that are also listed in the manual.

After typing any new condition, then you just click the blue-arrows to see what the condition matches.
This some conditions using the variable folder, which is really the whole "C:\Folder\Path\"...

Match anywhere below an exact folder-name of "nature 2".......... /.*\\nature 2\\.*/.test(object('folder'))
Match exactly 1-below (a parent-folder-name) of "nature 2"........ /.*\\nature 2\\$/.test(object('folder'))
Match from 1-3 levels below a folder-name of "nature 2"............ /.*\\nature 2\\([^\\]+\\){0,2}$/.test(object('folder'))
Match 4-or-more levels deeper than a folder-name of "nature 2"... /.*\\nature 2\\([^\\]+\\){3,}$/.test(object('folder'))

If not having the paid version, then you must instead drag the folders? or files? just like therube is describing.
But before dragging, its very important to first complete all of your Filters(12) settings and checkmarks ahead of time.
Because if you edit any Filters(12) after dragging, the dragged-files will disappear, so then must drag them all over again!

If you are only renaming files? and anywhere? below a folder-path having \nature 2\, but dont yet have the everything.exe...
In BRU, first to put a fake-drive like XXX:\ in the folder-path, and Filters(12) with a checkmark in "Subfolders" and "Files".
Inside of windows explorer.exe, use a search like... path:~"*\nature 2\*" type:folder so then dragging these folders into bru.

After dragging the folders into bru, bru will present the files inside of each of the dragged-folders.
If you did put anything inside for the Filters(12) "Mask", then only the matched-files would be presented.
Just remember to complete all of your Filters(12) settings before dragging anything, or else must drag them again!
Posts: 477
Joined: Fri Feb 21, 2020 10:58 pm

Re: subfolder dir

Postby Admin » Sat Jul 09, 2022 3:51 am

Did not know spaces could not be used in filters (12), by surrounding them with quotes... I think we need to add this to the a new build (ready soon).
Site Admin
Posts: 2148
Joined: Tue Mar 08, 2005 8:39 pm

Re: subfolder dir

Postby Admin » Tue Jul 19, 2022 9:38 am

Hi, the latest version now supports quotes (") for filters (12) to handle filters with spaces.
Site Admin
Posts: 2148
Joined: Tue Mar 08, 2005 8:39 pm

Return to How-To