The PrintStream should be created one time outside of and before the loop.
The code should not create a new PrintStream evey time the loop goes around.
The PrintStream should be closed after all the writing to it is finished.
It would be helpful for you if the code also printed out each line after it was read so you could see what was being read from the file.