I'm currently writing an app that takes the data from the file. I need to sort the data in different ways. The problem is that the file is in format:
NAME1(tab)A(tab)B
NAME2(tab)C(tab)D
I want to split data into two ArrayLists, one will gather NAME1, NAME2 etc, so the first element of line, the second list will gather the rest.
Here's my code:
Scanner scan = new Scanner(new File(fname));
while(scan.hasNext()){
}
scan.close();
System.out.println("Lang: ");
for(String item : lang)
System.out.print(item + " ");
} catch (FileNotFoundException e) {
e.printStackTrace();
}
I tried to play with scanner methods, but there are no results and I have no idea what to do.