Let's presume you have a text file called my file.txt with your data in it.
And let's give labels to each of the items in the row:
marker = $
label = vertex OR track OR begin, etc
x = your x value
y = your y value
z = your z value
eol = the last value on the vertex line
As we read each line, we can check to see if the line includes the term 'vertex'.
If it does, we then split that line using the split function (be default, split will split on whitespace, but let's explicitly call out what we want to split on (ie. ' '). Split produces a list of elements.
We can the use tuple unpacking to break each item out of the list and assign them individual labels so our code is more readable. We can then print the values. In your case, you probably want to save or process those values... just replace the print statement with your processing code.
file = open('myfile.txt')
for line in file:
if 'vertex' in line:
fields = line.split(' ')
marker, tag, x, y, z, eol = fields
print(x, y, z)