Zend certified PHP/Magento developer

Sort files into folders by file name according to a spreadsheet of names

I am a teacher and use Canvas-LMS for my course. The course is broken into smaller groups led by individual teaching assistants, who grade student assignments in their own section. Canvas only provides an option to download all student submissions to a given assignment. Downloaded submissions are automatically renamed in a single folder with the format lastName_firstNameRandomNumber_SubmissionTime.pdf.

I have another Excel spreadsheet of student’s names and their group numbers.

I would like to make some kind of script that can:

  1. compare the portion of the file name and the student name in the Excel sheet;
  2. find the group number in the Excel sheet and prepend it to the file name group1_lastName_*.pdf;
  3. sort the renamed submission files into folders such as group1 and group2.