@kissane My very first job had a similar task!
One of my responsibilities was babysitting an automatic build and test script written in Perl that I inherited.
The actual bulk of the script was the logic to colour the cells and insert the appropriate row and column spans so the table looked nice. The actual work I did was adding to an ever going switch block to handle the new ways the builds would break.