I have this code to read a txt file and remove any lines with not starting with "Date".
file1 = open('XXXXXX.txt',
'r', encoding="ISO-8859-1")
file2 = open('XXXXXX-Update.txt',
'w', encoding="ISO-8859-1")
for line in file1.readlines():
if line.startswith(("22/11/2021")):
print(line)
file2.write(line)
file2.close()
file1.close()
I would like a way that it was possible to put a date range like (("01/01/2021" >>> "12/31/2021))
Thanks