Plenty of text editors to automate converting the list of book ids to script. I use
Notepad++ on Windows. Easy to do a regex search and replace of the list and save the result as batch file.
For example (using a csv/tag-type custom column for multiple values and easy access via tag browser):
1234
5678
to
calibredb set_custom #process 1234 "edit"
calibredb set_custom #process 5678 "edit"
Notepad++
search: ^(.*)$
replace: calibredb set_custom #process \1 "edit"
Really convenient particularly when one needs to mark hundreds (or even thousands) of books.