• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 894
  • Last Modified:

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"));
0
monica73174
Asked:
monica73174
  • 2
2 Solutions
 
objectsCommented:
following shows how to read a file line by line

http://www.objects.com.au/java/qa/1052695124.html
0
 
objectsCommented:
readLine() returns null when eof is reached

0
 
monica73174Author Commented:
thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now