Well there really isn't an easy way to do that. The data that would need to be deleted would be copies of the data before it, as well as the number of rows that would need to be deleted would be different between each set. You'd have to scan the array for a change in a column, save that number then delete the next however instances of that same number until a new number showed up. I guess a C program could do it without that much of a hassle, but that is making the problem way more complex than the solution seems like it needs to be.