I have a arrayList with multiple entries.
And I would like to grab the first entry and the look in a file and grab a certain line.
After that I would like to grab the second entry from the arrayList and look that one up in a file.
Now I made this code for it:
for (int i = 0; i < arrayList_Code_Sorted.size(); i++) { String code = arrayList_Code_Sorted.get(i); // // while (sc.hasNextLine()) { // Grab very line separate. String line = sc.nextLine(); // Split the line by ever "tab". String value[] = line.split("\t"); // Get start String start = value[2]; // Get end String end = value[3]; // Get strand String strand = value[1]; String possible = start + "_" + end + "_" + strand; //System.out.println(line); // if (possible.equals(code)) { // System.out.println(line); } } }
I expected this to do what I would like.
But it only looks up the first value of the arrayList in the file.
And that is it.
Why doesn't it do the while loop more often?
I know the for loop works, but the while loop only gets activated the first time...