Search Specific Keyword From a File and add description associated to it to different file with Python
<p>Below text file shows the Description of Channel Name &amp; the Channel Event</p>

<p><strong><em>desc.txt file:</em></strong></p>

<pre><code>Channel Name: CBS
Event Name: FIFA World Cup 2018 Qualifying

Channel Name: BEINSPORTS
Event Name: NFL 
</code></pre>

<p>Below Python code only looks for the First "Event Name" and associated description. </p>

<pre><code>flist = open('/tmp/desc.txt').readlines()
    for line in flist:
        if line.startswith("Event Name:"):
            eventname = line[12:-1]                  
            file2 = open('/tmp/test_live.txt','w')
            file2.write(eventname + "\n")
</code></pre>

<p>What I want is the below description and what I am getting currently is 
"FIFA World Cup 2018 Qualifying" in the file. </p>

<p><strong><em>test_live.txt</em></strong></p>

<pre><code>FIFA World Cup 2018 Qualifying
NFL
</code></pre>

<p>What the previous posts indicated with the implemented code.</p>

<pre><code>flist = open('/tmp/desc.txt', 'r').readlines()
file2 = open('/tmp/test_live.txt','a')
for line in flist:
    if line.startswith("Event Name:"):
        eventname = line[12:-1]                  
        file2.write(eventname + "\n")
#Close Open File handlers
flist.close()
file2.close()
</code></pre>

python file python-3.x