Print lines with a given value
<p>I am trying to run some simple code in python to read a text file and print only lines with a certain value in the last column.</p>

<p>This is the text file:</p>

<pre><code>234 324 4
124 35 5
13 434 7
34 465 1
41 46 2 
25 62 2
</code></pre>

<p>and my attempted code is </p>

<pre><code>data = np.loadtxt('SelectValueTest.txt')

line = range (0,5)
for line in data:
    for n in data[:,2]:
        if n ==1:
            print line 
</code></pre>

<p>I know that I need to change the <code>print line</code> bit as this is just printing every line if any of them include to value <code>1</code>, but I'm not sure what to put?</p>

<p>Sorry for the really basic question! I'm just starting out and struggling to get the hang of it!</p>
