datalogger for counter sensor with RTC HELP!

however, i wish i could make something like this where you don't include the data of sensor A when the sensor B was incremented, like this

Hard to see in that tiny picture, but writing out the changed value in column 1 or column 2 or both is trivial. If one or more values change, you need to write a record. For each column, determine what to put in that column - a new value or a series of spaces. Then, write the record.