Here's the code to read in the .txt file and store it in the string array from the above example
String temp = "";
BufferedReader in = new BufferedReader (new FileReader ("PieceData1.txt"));
while ((temp = in.readLine ()) != null)
{
fileCount = fileCount + 1;
}
in.close ();
System.out.print ("Size of file is: " + fileCount);
// size of file has been stored
// use the size of the file to make an array of the specified to size of the file
String fileData [] = new String [fileCount];
in = new BufferedReader (new FileReader ("PieceData1.txt"));
for (int i = 0 ; i < fileCount ; i++) //
{
fileData [i] = in.readLine ();
}
in.close ();