I have a slight delema with learning FileWriter… The ultimate goal is writing a program that will “spawn” a .bat file that will be executed by the batch code that launched the .jar. The problem is, I have no clue how to make sure that every FileWriter.write(); will print on a new line… Any ideas??
Share
To create new lines, simply append a newline character to the end of the string:
Also, the
PrintWriterclass provides methods which automatically append newline characters for you (edit: it will also automatically use the correct newline string for your OS):