Is that what you want?
Your "dat" file:
Crying time
20:31:47
23:33:46
10:20:00
11:30:00
12:15:00
The code:
import re
with open("dat", "r") as msg:
text = msg.readlines()
text = re.sub(r"[A-Za-z]","","".join(text)).replace(":"," ")
print (text)
Output:
20 31 47
23 33 46
10 20 00
11 30 00
12 15 00
Your text data are in a "dat" file. You read the file line by line in a list using the readlines() method.
Then, you remove your header by using the re.sub method which replaces letters by nothing over the join product of your list (which yields a string). Finally, you replace the ":" by a space to print the output.
Alternatively, you can do:
with open("dat", "r") as msg:
text = msg.readlines()
for i in range(1,len(text)):
print (text[i].strip().replace(":"," "))
Which yields the same output.