I want to read in the 1st, 4th, 7th, etc. (every 3 lines) from a text file but am not sure how to go about doing so as nextLine() reads everything sequentially. Thank you for your suggestions?
Scanner in2 = new Scanner(new File("url.txt"));
while (in2.hasNextLine()) {
// Need some condition here
String filesURL = in2.nextLine();
}