Dec-08-2020, 10:11 PM
thanks for the new code,
I run the new code:
if I write a number in "csv_last_read.csv" and save the file, let's say 3, when I run the file, it prints all rows after row 3.
I run the new code:
csv_filename = "my.csv" csv_read_counter_file = "csv_last_read.csv" try: with open(csv_read_counter_file, "r") as f: lines_read = int(f.readline().rstrip()) except: # On any error, just reset back to start of file. lines_read = 0 with open(csv_filename, "r") as f: for index, line in enumerate(f): if index <= lines_read: continue print(line.rstrip()) with open(csv_read_counter_file, "w") as f: f.write(str(index))now it prints all the data at once, I have now 20 rows of numbers in CSV file instead of 10 to test.
if I write a number in "csv_last_read.csv" and save the file, let's say 3, when I run the file, it prints all rows after row 3.