I'm using a BufferedWriter to write some data to a textfile. It's faster than using ODBC to write to Access. Code looks something like this:
BufferedWriter bw = new BufferedWriter(new FileWriter(new File(filePath), true));
True is to make the BufferedWriter append, not overwrite.
bw.append(
country + "\t" +
scenario + "\t" +
tempStage + "\t" +
year + "\t" +
tempState
);
It's worked for me in previous projects. New problem: it just craps out in the middle of the line. This is a good line:
SultanateOfBrunei BeeBeeScenario Other 2019
The last line typically looks like this:
SultanateOfBrunei BeeBeeScenario Other 2019 Nondyna
or Sulta
or even Su
I put in error handling code to ignore weird incomplete lines like that.
This means not all the data is being written. I can give up one datum, no problem... But it appears to be cutting out more. The simulation runs 1990 to the end of 2020 and it typically craps out somewhere in 2019. Increasing the VM helps a little-- it gets further. But I only have a certain amount of memory!
Any insights?
Thanks!!