Help with select filter

Hi-

I am trying to create a select filter that will select all of the sub folders and files in a directory so i can delete them. the structure is as follows:

Main DIr
Dir1
Files and folders to be deleted - contains files, folders, sub folders etc
Dir2
Files and folders to be deleted- contains files, folders, sub folders etc

I want Dir1 and Dir2 (to DirN - there are about 50 dirs) to remain untouched under Main DIr, and I want to delete . within each dir.

Thanks for the help,

Mike

If the select filter cannot accomplish this - perhaps someone could recommend another method or perhaps other software to help me accomplish this?

The real reason behind it is to clean out my World Of Warcraft addons directory. I have some software that will fetch the latest addons based on the names of directory's in the addons folder - what it doesn't do is delete obsolete files. So- I would like to preserve the directory names in the addons folder while deleting all content "inside" of them.

I was hoping DoPus could help me.

Sorry, I meant to reply to this thread when you posted but forgot to go back to it. Have been moving house. :slight_smile:

You should be able to do this using Opus and a delete filter, filtering by location.

Do you want to delete everything in all subdirectories of the starting directory, or would there be certain subdirectories that you want left untouched? Both are possible but the former is easier than the latter.

An alternative way to do this is to use a button which creates folders in a temp directory with the same names as those in the source directory, then delete everything in the source and move everything in the temp back over. Same result but different process. If that would be more useful let me know and I'll dig up the button which does it.

Hi!

thanks for the response!

I would like all of the root directories to stay, and absolutely everything underneath them to be gone, files and folders and below.

Directory structure:

Addons
--Addon #1
-- Folder
-- file
-- file
--Folder
--Addon #2
.
.

etc.

What i want is

Addons
--Addon1
--Addon2
.
.
.

With addon1 and addon2 completely empty, but the addon# directories preserved. I have a mod that will "fill" them back up from a svn server based on the name of the addon# folder names.

Thanks!

Probably a filter with a Location of ** would do it (add as many levels of *\ as necessary to get to your "root" folder)

For example, if the root folder is C:\Blah\ (that is, you wanted all the folders in C:\Blah to remain but their contents to be gone) you could use a location filter of ****.

What this means is "match any location that matches ****". So, C:\Blah\xxx would not match (and therefore not be deleted), but C:\Blah\xxx\yyy would.

Hello-

Thanks for your reply.

The behaviour I am seeing with the find filter when I use location/match is only files that are 4 levels deep are being found - all others higher in the hierarchy are being ignored.

Have you got the filter the wrong way around? (Match vs No Match)

Hello!

I have it setup as location; Match ; C:\Blah**** where "blah" contains the directories I wish to keep, but have their contents deleted.

That sounds like the right thing to do but I guess we're missing something.

Try using the same filter in the Find panel and see what results you get. All items in the results list should be deleted when the filter is used for a delete operation.

Post a screenshot of the find results + filter if it still doesn't make sense. That might allow one of us to see what we've all missed so far.

Hello!

Thanks for helping me out!

Screenshots attached.

I should note that the directory structures can go infinitely deep - they are not limited to 4 levels.

I would like to further complicate matters :slight_smile: there are some folders in the addons folder I do NOT want deleted.

I am a lifelong DopUs user - that will not change. I downloaded a trial of a competing product and it did this no problem. The key was the ability to search with AND/OR and NOT. Not was the key.

I started the search, in this other tool - with addons*.*

Next, I added a qualifier, addons*

Then I added addons\addon_to_omit_from_purgefor every directory I wanted to delete.

So, this is not a free product I tried, but it works. I know DoPus can be made todo this :slight_smile:
screens.zip (574 KB)

You can do the And/Or/Not stuff in Opus as well. (See below.)

Everything seems to work fine to me. I created this set of test dirs and files (only the files are shown to save space but you can see the dirs they're in too):

Then I ran a similar query to yours, but also added an extra condition to demonstrate how to hide one of the directories ("Dir2" in this case). As you can see, the expected files and folders are matched and would be deleted:

If you want the folders left alone, even though they're below the 4th level, then you can add a line which matches by type. There are special File Only and Folder Only types in addition to all the system filetypes.

Hello!

Thanks for the effort you are putting into this.

EDITED

I was able to get it to work, although it was not as intuitive as I would have liked - that being said - it works like a charm.

Location Match C:\Addons*

Location NoMatch C:\Addons**

Location NoMatch C:\Addons\addon_filename_to_keep

This works. The second line is a bit wierd- but - it avoids deleting the addons directories.

Thanks again for all of the help... Now, if I could only configure this to be a button :slight_smile:

[/img]

I guess you didn't expect the * at the end of Addons* to also match further subdirectories?

  • will match any character, including .

You could use a regular expression to combine the first two lines but regular expressions fast become unreadable annoyances in this situation so it's probably best to stick with what works and is simple.

You can save your filter and then create a button to select or delete using that filter. Look in Opus Help under the Select and Delete raw commands for the Filter option.

You can save your filter and then create a button to select or delete using that filter. Look in Opus Help under the Select and Delete raw commands for the Filter option.[/quote]

Thanks Ken- I appreciate it ... I am also from the Detroit area- go Lions! lol