title: Create dynamic text files with data from another CSV file using python
body: <p>I need to dynamically create .txt files with the some portion of data from another CSV file. The csv file contains-</p>
  
  <blockquote>
    <p>"Cox's Bazar is the longest natural sea beach in the world. The beach
    in Cox's Bazar is an unbroken 125 km sandy sea beach with a gentle
    slope.It is located 150 km south of the industrial port Chittagong.</p>
    
    <p>The Sundarbans is a natural region comprising southern Bangladesh and a small part in the Indian state of West Bengal. It is the largest single block of tidal halophytic mangrove forest in the world"</p>
  </blockquote>
  
  <p>What I need is to create two text files from this csv. As there is a new line between these two paragraphs I need to divide the csv file according to the paragraphs. If there are 3 paragraphs, there will be 3 different .txt files. Although I am new in python, my code is given below-</p>
  
  <pre><code>import csv
  with open('INPUT_FILE.csv') as csvfile:
      reader = csv.DictReader(csvfile)
       for row in reader:
           print(row['text'])
  </code></pre>
  
  <p>I know how to detect a new line <code>if not row.strip():</code> is to be used. But I can't just make the conditions right between these two codes. Or is there a better solution for this? Any kind of help would be much appreciated. I am kind of stuck here. Thanks in advance!</p>