The code below is the first step I have taken to create a program for an assignment that
is supposed to read from a file that contains information about gold medal winners from the Olympics.
I have attached the .txt file I am using as my source for input.
My problem is that for some reason, my BufferedReader starts reading a line 3/4 of the way through the file
which is not what I need, I need it to start reading from the first line!
Any help is greatly appreciated, my code is below!
Thanks!
import java.io.*; public class TestGoldMedals{ public static void main(String[] args){ BufferedReader input; String line; try{ input = new BufferedReader(new FileReader("a2a.txt")); line = input.readLine(); while(line != null){ line = input.readLine(); System.out.println(line); } input.close(); }catch (IOException ioe){ System.out.println(ioe.getMessage()); } } }