create collection based on file names

Given a list of file names, how can I create a collection in darktable?

I can do this manually in the collection module. (And in the filter/sort module too.) But my file name list is quite long (some hundred entries), therefore I would prefer another option.

If there is a way to import such a list in another format, I can easily convert it (e.g. to XML or whatever).

Example of a list (the file names are unique in my database):
PA120471.JPG
PA120469.JPG
PA100287.JPG
PA100284.JPG

PS: My ultimate goal is to asign a tag to all the pictutres in the list. So if there is a way to to this without creating a collection first, that would help too!

There’s no way within darktable to create a collection from a list of filenames.
But you could use exiftool and some (bash) scripting to set the tags you want. (perhaps the safest solution would be to modify the sidecar files).

But I can’t help wondering how you got the list of filenames in the first place. You can select multiple files in darktable, and then assign one or more tag to all of them in one operation.

Maybe this workaround would be usable for you?

  1. Quit darktable
  2. Run a SQL similar to the one outline here: How to filter for a month? - #21 by Pascal_Obry
    You’d have to replace the where clause in the SQL.
  3. Start darktable, and do whatever you want with the selected images (e.g. assign a tag you can later use to select them again).

You could even assign the tag directly via the DB. :slight_smile: