You can run a for loop and use array.at(0,loopindex) which increments at 0,1,2,3 etc, the only problem is when you find a 0 and delete the row it pushes everything up and will skip some rows, so you could use the for loop and when a 0 is found delete the row and run the loop again until no 0 are found.