Deleting titled folders in a database

I have a database with 37000 folders of mixed Kinds contained in many Groups. I want to slim down the contents by removing a considerable number of folders so that I end up with only folders entitled Document in the Name column and PDF Document in the Kind column

I would like to delete all folders entitled Email Message in the Kind column of which there are many but I only want to delete those Email Messages which have no attachments ie no paper clip after the title in the Name column. I need to do this so that I can check those remaining with attachments to see if any of the attachments should be opened and entered as a Name Document Kind PDF document, if you’re still following me!

On the same topic another Kind is entitled PDF+Text. Within this category many are entitled ‘ID’ in the Name column. I would like to delete those

Is any of this possible and, if so, how do I do it please? I fervently hope that the answer is no and I have to do it manually!!

Is it possible to delete all of those folders without affecting the Groups in which they are located?

A little confused: you have 37,000 folders and you also have some unreported number of groups. Folders and groups are usually the same thing, unless of course you’re counting smart groups.

Otherwise, you can do all of what you wanted to do by setting up various smart groups with the search parameters you outlined in your post. Inspect the smart groups to confirm that the documents shown in a given smart group are the ones you want to delete. Then, select the documents that should be deleted and use “File > Move to Trash”.

(There’s a shortcut for sending documents to the trash, but when doing drastic changes to a database I prefer to think about what I’m doing and use the slower approach of clicking a command in a menu.)

Start this process slowly and carefully. Creating one smart group at a time (say the Email messages), and spending time inspecting the results before making deletion decisions.

If you have 37,000 things to look at, spread the work over several days or longer.

It’s a good idea also to look at the Trash one last time just to be sure before you empty the trash.

Keep good backups (multiple backups for example) of your database(s) before doing major surgery on them.

Or, as you said:

Sure, OK. Yes, the answer is NO if that’s what you want to hear!! LOL


You can’t delete a group without deleting its children, groups and files.

It’s unclear what your end product is supposed to look like.
Please mockup a small sample of what the end result is and post a screen capture of it.

Not completely clear on the criteria,
but my go-to solution is an Applescript
It can delete the required records based on your rules

The closest thing coming to my mind is ungrouping.

Thanks to all who have commented. I apologise for not having made the position clearer

I have a simple business which basically involves finding out client’s requirements then meeting the client, taking ID and witnessing their signatures to their document(s)

I create a Group for the year, which itself is a sub group of the main named database.
When a client first makes contact I create a sub Group with a date and their name.
All subsequent notes, documents and emails are filed as folders in that sub Group

I’ve kept records for the last 18 years so I’ve got something like 3000 client sub Groups containing 34000 folders

I attach a screenshot of a mock up as suggested by Bluefrog to explain the setup which contains examples of the folders I want to delete and those I want to keep

While DT has been a godsend to sort my Groups and Folders on a day to day basis, the info I’m required to keep by my Regulator is probably no more than 4000 Folders containing copy documents, the rest is not relevant for this purpose, hence my wish to produce a shrunken database

My use of DT has been extremely basic, I’ve just used it as a database and to my shame have used almost none of the whistles and bells available. In those circumstances it won’t surprise you to learn that I have never knowingly created a Smart Group, so you’re going to have to be gentle!

Korm made it sound wonderfully simple, if I had the expertise! I’ve got a copy of Joe Kissel’s Take Control of DEVONthink 3 which has been helpful in the past and I probably just need pointing in the right direction

Mockup.pdf (180.6 KB)

Smart groups are a possibility but hard to maintain. Here’s a completely different approach:

  1. Add a unique tag to each PDF document, e.g. PDF. Really imaginative, I know :slight_smile:
  2. In the sidebar activate the Tags filter (see bottom bar of sidebar)
  3. Select the PDF tag

Now you should only view PDF documents and groups containing PDF documents.

And the Tags filter pane is also available via Tools > Filters.

Would that mean that I would have to tag all 4000 documents individually or would one tag, appropriately worded, applied to the 37000 folders, isolate the folders responding to the description? I don’t fancy the first alternative!

Having looked at the database more closely I’ll have to do a lot of tidying up because unfortunately not all relevant folders have the requisite description

I’ll have a look at how tags work

You have to tag only the PDF documents, e.g. search for kind:PDF, select all results, finally use Tools > Batch Processing… to add the tag.