Move files based on a list

is there a way to organize the content of a receiving folder based on a text file? The text file contains lines of 5-digit codes, and the script will match the codes to those in the name of incoming files and organize them accordingly.

Thank you!