I am writing in a file and I want it to output into a csv file this way:
Group Members
1 Name1
Name2
Name3
code:
FileWriter fw = new FileWriter(csv);
BufferedWriter pw = new BufferedWriter(fw);
pw.write("Group,");
pw.write("Members");
pw.newline();
String mem=some_method();
pw.write("1,");
pw.write(mem);
pw.newLine();
My String mem has '\n' every after the names and so when it writes in the file, '\n' is read then writes into the next line. How can i achieve the above output without modifying the some_method()?