I am a novice at any kind of data i/o. What I want to do:
My
Java program generates a series of data values (actually these are pairs of values, let�s call them dataA and dataB.), all as Double type. I want to output these pairs of values to a file, and then plot the data in graphs using an external package. The data are floating-point, e.g dataA =10.1, dataB = 1.075 could be one pair.
My program goes through the multiple entries in an ArrayList, each of which contains unique values of dataA and dataB.
None of the values can be negative.
Previously I have been taking a file produced from another source that had similar data pairs in an ASCII, tab-delimited set of columns, which I could process easily, either automatically into a graphing program, or by exporting / cut-pasting into Excel, etc. If I could reproduce this file format (ASCII, tab-delimited) I would be very happy.
What I�ve attempted so far:
--------------------------------
try{
DataOutputStream output = new DataOutputStream (new FileOutputStream ( "myFile.dat"));
for(int i = 0; i < myArrayList.size(); i++ ) {
simOutput.writeDouble( dataA (i) );
//simOutput.writeDouble( dataB (i) );
}
simOutput.close();
}
catch (IOException e) { }
-----------------------------------
This generates a file that has no formatting (or at least I don�t understand its formatting), and I don�t know how to interpret the gobbledygook in the file. Maybe it contains what I want, but I don�t know.
Any help would be appreciated.
------------------------------------------------------------------------------