Can a list of documents be sorted by their content?

Hi,
I have plain text notes in a group, each with rows of dates like:
File 1:

2021-02-25 ... other data
2021-01-11  .. more data

File 2:

2021-03-25 ... other data
2021-01-14  .. more data

Within each note, the rows are ordered with most recent date on top, descending to older dates.

So if I have a bunch of documents like this, it would be handy to order them within the group by the content of the document, so the document with the most recent date would be sorted in the group to be on top (in this example File2 would be more recent). Is there a way to do this?

As a workaround, I added a new field recent-date where I take the topmost date from each document and copy it into the field, then I can sort the files by recent-date.

But that is maintaining the date in two spots, it would be easier to just sort by note content.

Thanks!

You could e.g. use Tools > Batch Progressing…, add the action Change Modification Date > Newest Document Date and then sort the documents by modification date.

I don’t know much about DT batch processing, but as if I understand correctly, the documents would be sorted by modification date. But my use case, the dates I type in the document don’t correlate with the date modified. I might update a document with a date that is months old where if there are 2 documents with newer dates, I would want the edited document to sort to third in the group.

To illustrate, if the first characters (which are dates) in 4 plain text documents are as follows (sorted by document content):
File 1: 2022-03-22
File 2: 2022-03-20
File 3: 2022-02-22
File 4: 2022-01-25

If I add a more recent date to File 4 so File 4 contents are now:

2022-02-27
2022-01-25

Then I would want the files in the group to now be sorted as follows (showing first line in each file):
File 1: 2022-03-22
File 2: 2022-03-20
File 4: 2022-02-27
File 3: 2022-02-22

Sort by document content would easily solve this (maybe future feature?).

In the meantime, I’ll use the extra field I created and sort the documents by that even though I have to duplicate data and copy to that field.

Thanks

The modification date would be changed by the suggested batch processing to the newest date in the document. Which should be exactly what you want.

By the way: While researching whether I should get a NAS (Network Attached Storage) or a DAS (Direct Attached Storage) I discovered that DEVONthink accepts several different date formats as input in Custom Meta Data of type date. Never used this type manually before. It was very very handy to copy a given date and paste it into my Custom Meta Data column. Thanks a lot!

(Would have been even simpler if I used the Document Date but didn’t think about that)