Hello Steve.
There are some examples that do a little of what you describe, but none that do exactly what you need. Here are examples from the GitHub :
You might consider sorting the data by Subsystem, prior to executing Table Tool. If your data is in a Comma Separated Value format and DFSORT is your sort tool, consider using the sorting items here .
If you cannot sort it, then there still is a way, but it gets a little more complicated.
In any event, if you give me an opportunity to help, it can be a new candidate for the Table Tool examples.