How to Copy Rows from one CSV to other CSV File using python : I'm trying to coping rows from one CSV to other and trying to remove row after being copied from the first file.. please see the code it's working for only copy specific rows from one csv to other

    import csv
    import os

    File1 = 'in.csv'
    File2 = 'out.csv'

    with open(File1, "r") as r, open(File2, "a") as w: 
         reader = csv.reader(r, lineterminator = "\n")
         writer = csv.writer(w, lineterminator = "\n")

         for counter,row in enumerate(reader):
             if counter<0: continue
             if counter>50:break
             writer.writerow(row)


Please let me know how this would work after coping the rows to the File 2 and remove that rows from File 1

         
