05 10

Write next line in file java

write next line in file java

Change the lines

if(nodeValue!=null) fop.write(nodeValue.getBytes()); fop.flush();


if(nodeValue!=null) { fop.write(nodeValue.getBytes()); fop.write(System.getProperty("line.separator").getBytes()); } fop.flush();

Update to address your edit:

In order to write each word on a different line, you need to split up your input string and then write each word separately.

private static void GetText(String nodeValue) throws IOException { if(!file3.exists()) { file3.createNewFile(); } FileOutputStream fop=new FileOutputStream(file3,true); if(nodeValue!=null) for(final String s : nodeValue.split(" ")){ fop.write(s.getBytes()); fop.write(System.getProperty("line.separator").getBytes()); } } fop.flush(); fop.close(); }

write next line in file java Java.io.BufferedWriter.newLine() Method Example

Java - Learn line line file by to Java write Online


  1. Vodovozoyoyu

    Please pray for me. I feel i have no choice but to file and this time for good next week. It is app~

  2. Vudehupu

    Today Y2 learned more about QR codes in ICT how to create their own! Their monster fact file posters will be up around school next week!

  3. Xuwoneta

    I only kill your this file. But next time i will kill you all. I will be com back and become fierce. Neko version 1.0

  4. Yabazeje

    Will Hillary file from Bill now and stand next to BFF Human as another Victim

  5. Bohojohan

    - Coinbase Users File Motion to Block IRS’ Bitcoin Tax Summons

  6. Momoyepacuroda

    Was it because he didn"t like the slash burn draft budget. But-smart move. Keep name on file so the next president can talk with him.

  7. Rijenobepu

    Who cares really- next Hillary needs to file for divorce to be taken seriously- must divorce they have child.

  8. Sejohurijid

    I think the next time I"m on a train someone starts to file their nails I"m going to either pick my nose flick it or cut my nails!!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>