Hi All I am using this code to append text in a txt file.anyone can guide me how i can add line break for this case
fOut = new FileOutputStream(new File(myFilePath + BlueFreeConstants.logFileName), true);
osw = new OutputStreamWriter(fOut);
osw.append("<< " + values + " >>");
osw.flush();
osw.close();
fOut.close();
String separator = System.getProperty("line.separator");
fOut = new FileOutputStream(new File(myFilePath + BlueFreeConstants.logFileName), true);
osw = new OutputStreamWriter(fOut);
osw.append("<< " + values + " >>");
osw.append(separator); // this will add new line ;
osw.flush();
osw.close();
fOut.close();
osw.append('\n')
. Is that what you're looking for?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With