I need to build a python code to store the python numbers that are in a file. The lines where those numbers are starts with a word "Mark" and then I have blank spaces and three columns of numbers, like this:
Mark 1 2 3
Mark 4 4 6
Where the number of blank spaces between the numbers are not known. I know how to read the file line by line searching for the word line:
with open("doc.dat") as file:
for line in file:
if line.startswith("Mark"):
But I do not know how to call the condition for extracting the numbers and passing them to a variable. How can this be done?
Thanks in advance