Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Danielle Daniels   on Dec 24 In Java Category.

Question Answered By: Ludo Ricci   on Dec 24

Here is one way of reading  a file  row after row:
String pathToFile = filename; //filename to read in
String recordHolder; //holds line of data
File in = new File(filename);
try {
BufferedReader InFile = new BufferedReader( new
FileReader(in) );

//get record from input file
while(( recordHolder = InFile.readLine() ) != null)
//put your code here
} catch(IOException ioe){//error code here }



This Question has 1 more answer(s). View Complete Question Thread

Didn't find what you were looking for? Find more on help reading file Or get search suggestion and latest updates.