Are you sure you have compiled the above-posted code? Unless it was a copy-paste mistake, it's missing a close curly brace right at the end of the code listing to close off the class. Once the close curly brace is added, even with a completely empty output.txt file you'll get a "Number of paragraphs: 1", or a FileNotFoundException if output.txt is absent. Therefore it may be that it isn't compiling, and you have been testing with an earlier compiled but incomplete version of your code.
If this is not the case, please post your code that has println debug statements added, and attach a zipped copy of output.txt (in case there are hidden control characters messing things up).