I am writing into a text file and i am using System.getProperty(line.separator); to go to next line.
FileWriter fw = new FileWriter(file,true);
fw.write("Correct Fields are:"+System.getProperty("line.separator")+"\r\n");
"\n" was not working before so i searched on the web and found "\r\n".
What is "\r\n" ? Is it notepad specific ?
\r is carriage return and
\n is line feed.
This format is OS specific. For windows/DOS \r\n is required.
For unix \n will be enough
and for mac \r is used. (until Mac OS 9).Since Mac OS 10+ , \n is used.
Hope this helps.