I am trying to write to a text file with information stored like this.
brick 500
stone 500
And so on. Here is the code I am using to write to the file.
switch(record){ case "brick": x.format("%s%n", "brick " + value); closeFile(); break; case "log": x.format("\n%s%n", "log " + value); closeFile(); break;
When I write like this, putting \n deletes the first line. Any ideas what I can look into or other functions that would be useful?