I am iterating over the table and I want to parse column 1 and column 2 into 2 separate arrays. I am not sure how to do this. Here is the code I have written so far:
while (line !="table_end"){
for (line = bufferedReader.readLine(); line != null; line = bufferedReader.readLine()){
String[] rowData = line.split("\t");
for (int i = 0; i < rowData.length; i++) {
String id = rowData[0];// ids
System.out.println(id);
String nid = rowData[1];// names
System.out.println(nid);
//create arrays out of this
The loop extracts the first (rowData[0]) and second row data (rowData[1]) from the table, and i want to store all rowData[0] entries in one array, and rowData[1] entries in another array.
Besides that, i get an error when the loop ends, because it includes the line "table_end".
The table looks like this:
data0 data1 number number number etc
data0 data1 number number number etc
data0 data1 number number number etc
this goes on for about 1000 rows
table_end
I am a beginner in Java and I need advise on how to store each rowData[0] and [1] in separate arrays and how to not read the last line, "table_end".