SyntaxFix
Write A Post
Hire A Developer
Questions
Split the string in to string array and write using above method (I assume your text contains \n to get new line)
String[] test = test.split("\n");
and the inside a loop
bufferedWriter.write(test[i]); bufferedWriter.newline();