Delete duplicate rows in textfile - except it contains a "{" or "}"
<p>i have a very large textfile with contents like: </p>

<pre><code>@INBOOK{Ackermann1999-b, 
  author = {Ackermann, K.-F. and Ackermann, K.-F. and Ackermann, K.-F. and Ackermann, 
        K.-F. and Ackermann, K.-F. and Ackermann, K.-F. and Ackermann, K.-F. 
        and Ackermann, K.-F. and Ackermann, K.-F. and Ackermann, K.-F. and 
        Ackermann, K.-F. and Ackermann, K.-F. and Ackermann, K.-F. and Ackermann, 
        K.-F. and Ackermann, K.-F. and Ackermann, K.-F. and Ackermann, K.-F. 
        and Ackermann, K.-F. and Ackermann, K.-F. and Ackermann, K.-F. and 
        Ackermann, K.-F. and Ackermann, K.-F. and Ackermann, K.-F. and Ackermann, 
        K.-F. and Ackermann, K.-F. and Ackermann, K.-F. and Ackermann, K.-F. 
        and Ackermann, K.-F. and Ackermann, K.-F. and Ackermann, K.-F. and 
        Ackermann, K.-F. and Ackermann, K.-F. and Ackermann, K.-F. and Ackermann}, 
  year = {1980}, 
  timestamp = {1995-12-02} 
}      
</code></pre>

<p>And i want to delete the duplicate rows except these rows containing the brackets { or }. 
The result should look like: </p>

<pre><code>@INBOOK{Ackermann1999-b, 
  author = {Ackermann, K.-F. and Ackermann, K.-F. and Ackermann, K.-F. and Ackermann, 
        Ackermann, K.-F. and Ackermann, K.-F. and Ackermann, K.-F. and Ackermann}, 
  year = {1980}, 
  timestamp = {1995-12-02} 
} 
</code></pre>

<p>I come across with this Python-Skript, thanks to Vinay Sajip: </p>

<pre><code>lines_seen = set() # holds lines already seen 
outfile = open("literatur_clean.txt", "w") 
for line in open("literatur_dupl.txt", "r"): 
    if line not in lines_seen: # not a duplicate 
        outfile.write(line) 
        lines_seen.add(line) 
outfile.close() 
</code></pre>

<p>But it deletes also the lines with a closing bracket } and the lines with the same authordata. 
Therefor i need the condition of the brackets. </p>

<p>Could someone point me out to adding this condition? </p>

<p>Thanks in advance, </p>
