I was trying to write a code only to output the days and months from a log file. But there is a header in the first line. How can I get rid of it?
with open('running.log','r') as file:
lines = file.readlines()
data = []
for line in lines:
fields = line[:-1].split('\t')
date = fields[0].split('-')
time = fields[1]
temp = fields[2]
record = (date, time, temp)
data.append(record)
days = date[0]
months = date[-1]
print(days)
my output results are:
DATE
7
8
9
10
12
13
14
15
16
17
18
20
22
24
25
26
27
28
So how can I get rid of the DATE in the first line?