Hey guys, I was wondering if someone could point me in the right direction for some of my coursework.
I have a .txt file with a list of names, subjects, number etc on each line like so:
10007814 Cardiff University (F) Languages First degree Q06 2% 10%
And I need to extract information from the .txt file, so far I've done this:
import java.io.BufferedReader;
import java.io.FileReader;
import java.util.*;
public class SS{
public SS(String line) {
// TODO Auto-generated constructor stub
}
public static void main(String[] args) throws Exception{
ArrayList<SS> all = new ArrayList<SS>();
BufferedReader fh =
new BufferedReader(new FileReader("info.txt"));
String line;
while ((line=fh.readLine())!=null)
{
all.add(new NSS(line));
}
fh.close();
System.out.println("Print results");
}
}
I understand how to narrow down the results, but I don't understand how I'm suppose to get java to know that the first column in the .txt file is their number and say second column is the university, any help?