Oct-28-2022, 08:58 AM
You don't need testit.
try this (as I cannot test):
try this (as I cannot test):
import datetime def convert_date(orig): massaged_date = orig.replace("'", "/")[1:] return f"D{datetime.datetime.strftime(datetime.datetime.strptime(massaged_date, "%m/%d/%Y"), "%m/%d/%Y")}" def clean_file(filename): with open(filename,"r") as f: line = f.readline().strip() if line[0] == "D": convert_date(line) else: print(line) clean_file("ANCU.qif")line 11 could also read:
if line.startswith("D"):