Q:

How to extract data from .txt file that is separated by varying space size?

I am trying to extract data (date and time) from a .txt file, raise it one second and then compare it with the next piece of data so I can see if date and time are continuous.
For example:
15  6 19  9 12 59.0000000  
... some other stuff...  
15  6 19  9 13  0.0000000

The problem is that the number of spaces between the digits varies (one space if the data on its right is two digits, two spaces if the data on its right is one digit).
How can I extract the dates, increment one second and then compare them with the next date in the text without having to check for every space variation?

A:

You can use string.split() , this splits the string by varying spaces .
And example -
>>> s = "Hello  Bye          Test"
>>> s
'Hello  Bye          Test'
>>> s.split()
['Hello', 'Bye', 'Test']

