Not getting the full text in output
<p>I have 2 text files , from which I match the second column of txt1 with first column of txt2 before <code>|</code> , well I just mention it below , than I output if they are same , along with its discription , everything is going fine , but I didn't get the <code>new line discription</code> in the output , it just showed its first line.</p>

<p>Here is the content for <strong>txt1.txt</strong></p>

<pre><code>E5 E7 Bat
</code></pre>

<p>Here is the content for <strong>txt2.txt</strong>:</p>

<pre><code>?E7|E5
Addsadsadsadsadsadsdasd
Sdsdfsdfdsfdsfdfdsfdsfd
AasadsaddccxcvcsAAGCAGT
</code></pre>

<p>This is the code which i am using</p>

<pre><code>with open('txt1.txt', 'rb') as file1:
    #file1_data = dict(line.split()[1] for line in file1 if line.strip())
    file1_data = [line.split()[1] for line in file1 if line.strip()]
#print file1_data
with open('txt2.txt', 'rb') as file2, open('output.txt', 'wb') as outputfile:
    output = ""
    file2lines = file2.readlines()
    for i in range(len(file2lines)):
        line = file2lines[i]
        if line[0] == '?':
            row = line.strip().split('|')
            key = row[0][1:]
            if key in file1_data:
                output += line + "\t" + file2lines[i+1]
    outputfile.write(output)
outputfile.close()
</code></pre>

<p><code>Getting output</code></p>

<pre><code>?E7|E5
Addsadsadsadsadsadsdasd
</code></pre>

<p><code>Required output</code></p>

<pre><code>?E7|E5
Addsadsadsadsadsadsdasd
Sdsdfsdfdsfdsfdfdsfdsfd
AasadsaddccxcvcsAAGCAGT
</code></pre>
