the data file contains:
1908,Souths,Easts,Souths,Cumberland,Y,14,12,4000
1909,Souths,Balmain,Souths,Wests,N
1910,Newtown,Souths,Newtown,Wests,Y,4,4,14000
1911,Easts,Glebe,Glebe,Balmain,Y,11,8,20000
Each line represents a season of premiership and has the following format: year, premiers, runners up, minor premiers, wooden spooners, Grand Final held, winning score, losing score, crowd
What I need is to display a list of Grand Final held as 'Y'. In other words, how do I display a list of 'Y' which is after the 5th comma?
import java.io.*;
import java.util.ArrayList;
public class GrandFinal {
private static BufferedReader br = null;
private static ArrayList<String> al = new ArrayList<String>();
private static String line = "";
public static void storeArray() {
try {
br = new BufferedReader(new FileReader("NRLdata.txt"));
while ((line = br.readLine()) != null)
al.add(line);
}
catch (Exception e) {
System.out.println("Unable to find file.");
}
for (int i = 0; i < al.size(); i++) {
// this line.
}
}
}
}