Copying a column without repeating
<p>I need to access a .txt file, it has 2 columns and a lot of rows with repeated names (using Python).
I just want to copy one of the columns without repeating the names on it, printing it on a new .txt file. I tried:</p>

<pre><code>g = open(file,'r')
linesg = g.readlines()
h = open(file,'w+')
linesh = h.readlines()
for line in range(len(linesg)):
     if linesg[line] in linesh:
        line += 1
     else:
        h.write(linesg[line].split('\t')[1])
</code></pre>

<p>But I continue to have repeated names on the .txt file. Could anyone help me? (Yes, i'm a newbie on Python programming).
Thanks a lot!</p>
