title: Java read in single file and write out multiple files
body: <p>I want to write a simple java program to read in a text file and then write out a new file whenever a blank line is detected. I have seen examples for reading in files but I don't know how to detect the blank line and output multiple text files.</p>
  
  <p><strong>fileIn.txt:</strong></p>
  
  <pre><code>line1
  line2
  
  line3
  </code></pre>
  
  <p><strong>fileOut1.txt:</strong></p>
  
  <pre><code>line1
  line2
  </code></pre>
  
  <p><strong>fileOut2.txt:</strong></p>
  
  <pre><code>line3
  </code></pre>