My issue is: I want to sort my output file based on date/time. These files were concatenated from 5 directories to one outfile. So output has filewise entries and as per that sorted date/time, not as expected date/time sort applied on whole output file my code
my Code:
f = ['Dir0/fruit.log', 'Dir1/fruit.log', 'Dir2/fruit.log','Dir3/fruit.log', 'Dir4/fruit.log']
with open("outp/out2.txt", "w") as f1:
for fname in f:
with open(fname) as infile:
for line in infile:
f1.write(line)