You’ll first need to read the file in using a FileReader
and store it as a String
. You can then use String.split("\n\n")
to split it into paragraphs (this will give you an array with 3 elements).
You can then loop through each of those array elements, creating a PrintWriter
for each (to write each array element to a separate file.)