Link to home
Create AccountLog in
Avatar of monica73174
monica73174

asked on

Need to loop through a text file and load data into an array

I have a text file that I need to loop through and put the data into 2 seperate arrays.
For instance the data will look like this..
Mary Jones 16
How can I tell when I reach the end of the file.

This is what I have so far, I know its not much but Im still pretty new to Java.

Scanner inFile = new Scanner(new FileReader("Player.txt"));
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Avatar of monica73174
monica73174

ASKER

thanks