There are several syntax errors, as wll as logic errors.
Please tell us what you are trying to do, not how you think it should be done.
Example wild guess:
1. read a list of filenames
2. see if each one is in a directory then copy it somewhere
3. if file is not in the current list - delete it.
Please fix my guess to match what you want.