Read numerical values from a file with lines of strings : <p>I have a .txt file with N lines. I want to read the line number 8, and the line number 16, which look like these:</p>

<pre><code>2016-04-01 04:27:30.6216 (2283721) (more text)

2016-04-01 04:59:20.3635 (2283721) (more text)
</code></pre>

<p>How can I recover the values  04:59:20.3635 and 04:27:30.6216 and substract them? I tried with opening and reading the file using</p>

<pre><code>txt = open(filename)
for line in txt:
    print line
</code></pre>

<p>But I don't know how to store each line in a variable, and then access the specific part of the line that I want to reach. I've tried some stuff, but I want to know which would be the most efficient way to handle this. Many thanks!!</p>
