The CSV files output to instructors is so unorganized as to be unreadable. A student name should be followed on the same line with his/her entire attendance history so that it becomes obvious what that history is with poring over each vertical output. Who can read this stuff?
Create the CSV as a spreadsheet-friendly item, readable by humans.