how to save to a multi-dimensional array to text file
Posted on 2003-03-30
i have a method to load a text file. other methods then call this method to load the contents of the text file into an array.
JOptionPane.showMessageDialog(null, "TESTING: Inside 'Load File' method");
String flights = new String;
FileReader file = new FileReader("Assign.txt");
BufferedReader buff = new BufferedReader(file);
for(int row = 0; row < flights.length; row++)
for(int column = 0; column < 5; column++)
flights[row][column] = buff.readLine();
System.out.println("Error reading file"+e.toString());
JOptionPane.showMessageDialog(null, "TESTING: End of 'Load File' method");
anyway, as you can see i'm using a file reader to read the file into a buffer and then putting each line the buffer takes into a multi-dimensional array.
what i need to know is how to save to a multi-dimensional array to text file now and overwrite the current contents.
any help is appreciated