log_input.log
1949,1603441909,984159,0.002608,19.8829994202,0.0,640.0
950,1603441910, 416274
21,160340, 24666082,0.002608,19.81913,0.0,638.0
Check the column consistency, disregard the row if the column number are not consistent. Read the second column and convert the second column into local time format.
log_output.log
1949, 10-31-49,984159,0.002608,19.8829994202,0.0,640.0
21, 9-32-20, 24666082,0.002608,19.81913,0.0,638.0
Code:
with open('log_input.txt', 'r') as f:
csv_data = csv.reader(f)
csv_lines = list(csv_data)
for line in csv_lines:
line[1] = convert(line[1].split(':')[1].strip())