Jan-21-2022, 04:04 PM
A .csv is just a text file. The only way to remove part of a text file (and have it remain a useful text file) is to rewrite it with the later portions moved up.
One technique would be that as you are processing your loop you write all the lines that you want to keep to a new file. When complete, swap the new file into the old file's place.
One technique would be that as you are processing your loop you write all the lines that you want to keep to a new file. When complete, swap the new file into the old file's place.