Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2008-06-12
3
Medium Priority
?
846 Views
Last Modified: 2013-11-23
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
Comment
Question by:monica73174
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 92

Accepted Solution

by:
objects earned 2000 total points
ID: 21775964
following shows how to read a file line by line

http://www.objects.com.au/java/qa/1052695124.html
0
 
LVL 92

Assisted Solution

by:objects
objects earned 2000 total points
ID: 21775965
readLine() returns null when eof is reached

0
 

Author Closing Comment

by:monica73174
ID: 31466816
thanks
0

Featured Post

Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question