Monday, July 6, 2009

try {
FileReader read = new FileReader("namesToReadIn.txt");
BufferedReader readIn = new BufferedReader(read);
String line = ""; String total = "";
while((line = readIn.readLine()) != null)
{ System.out.println(line);
total += line;
}
String [] allTheNames = total.split(",");
System.out.println("There were " + allTheNames.length + " names read in"); } catch (IOException e)
{ System.out.println(e); }

No comments: