I’m away from my computer right now but I had an idea and I really wanna know if it’ll work.
Would this rough code work for getting groups of lines out of a text file (using BufferedReader br):
String line;
BufferedReader br = ....;
List<String> list = new ArrayList<String>();
while(line = br.readline() != null){
if(line.equals("Group1"){
while(line = br.readline() != "}"){
list.add(line);
}
}
}
Here would be the text file:
Group1
one
two
three
}
Group2
....
}
Try to use single loop like this: