Automate moving student files into student folders by name
I'm a Middle School math teacher with the following recurring task. I scan in a student's written work for the week into a pdf file with their name and a number (standing for the week of the grading period). I have 42 files in a directory. I have 42 sub-folders, one for each student, in the folder student work. Each week, I would like to copy the files of weekly work into the appropriate student folder.
For example, the file fred 2 needs to go into folder fred and the file amy 2 needs to go into folder Amy. The following week, it will be the same, except with fred 3 into folder fred and Amy 3 into folder amy.
It's not an odious task but since it comes every week, it would be great to automate. Thanks.
MacBook Air 13″, macOS 11.4