Just did a test. This is ugly, but it works.
Create a CSV file with the IDs of the People you want to delete in Square Brackets and a dummy surname. Then Import that CSV file to update the tree. (Data loss! Backup immediately before the import.)
Follow the format below. I use “DeleteMe” as the surname. Importing it will overwrite the names of all those people. (Note that the Given name is lost too… even though that isn’t one of the import columns.)
Now these deletable persons will be easy to filter out of the export.
Person, Surname
[I0008], DeleteMe
[I0001], DeleteMe
[I0010], DeleteMe
⋮
[I43115], DeleteMe
[I43116], DeleteMe
An export filter might look like:
(The “Return values that do not match the filter rules” is critical.)