title: Convert txt files in a folder to rows in csv file
body: <p>I have 100 txt files in a folder. I would like to create a csv file in which the content of each text file becomes a single row (actually, a single cell in a row) in this csv file. So, the result would be a csv file with 100 rows. </p>
  
  <p>I tried the following code:</p>
  
  <pre><code>import glob
  
  read_files = glob.glob('neg/*')
  
  with open("neg.csv", "wb") as outfile:
      for f in read_files:
          with open(f, "rb") as infile:
              for line in infile:
                  outfile.write(line)
  </code></pre>
  
  <p>This create a csv with over thousands of rows since each txt file contains multiple paragraphs. Any suggestion?</p>