title: Write single list to csv by column
body: <p>The following code searches for words given in the list and when matched writes the line to a csv row by row.</p>
  <p>I am trying to find a solution so that instead of writing by row only, the 1st item in the list is column1 and 2nd item to column2 and so on.</p>
  <pre><code>parm_list = [&quot;electricalAntennaTilt &quot;,&quot;iuantSectorId &quot;, &quot;eUtranCellFDDId &quot;]
  os.remove(&quot;Parm.csv&quot;)
  #keyword = input(&quot;Enter keyword here: &quot;)
  with open('Parm.csv', 'w', newline='\n', encoding='utf-8') as csvfile:
      writer = csv.writer(csvfile)
      writer.writerow([&quot;eNB&quot;, &quot;Parameter&quot;, &quot;Value&quot;])
  
  for filename in os.listdir(directory):
      for i in parm_list:
          if filename.endswith(&quot;.txt&quot;):
              with open(filename, &quot;r&quot;, encoding=&quot;UTF-8&quot;) as file:
                  for line in file:
                      if re.search(i, line):
                          with open('Parm.csv', 'a', newline='\n', encoding='utf-8') as csvfile:
                              writer = csv.writer(csvfile)
                              writer.writerow([filename] + [line])
  
  
      else:
          continue
  </code></pre>
  <p>Current Output:</p>
  <pre class="lang-none prettyprint-override"><code>315655.txt electricalAntennaTilt                30
  
  315655.txt iuantSectorId                        315655_1_4
  </code></pre>
  <p>Expected output:</p>
  <pre class="lang-none prettyprint-override"><code>315655.txt electricalAntennaTilt                30 iuantSectorId                        315655_1_4
  </code></pre>