Can someone tell me what's wrong with the following code?
<p>Everything works as it is intended except when info2 is written, sometimes the "143f" line doesn't exist that leads to info2 not existing so the written format is ruined.</p>

<pre><code>with open("saved") as f:
    with open("autolist","a") as f1:
        for line in f:
            ff=False
            if "062" in line:
                trim=line.find('"',64)
                info=line[64:endof]
                print info
                f1.write(info+":")
            if "143f" in line:
                trim=line.find('"',71)
                info2=line[71:endof]
                f1.write(info2+"\n")
</code></pre>

<p>If line "143f" doesn't exist then I'd want to write a "\n" instead of nothing. For some reason it doesn't work.</p>
