Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

File Reading

 
kalai sundar
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am reading a file , i want to exract each every word from the whole file, how i can do, hepl me, here is my code vat i am doing now, plz hepl me....

public void getContent(String s){
String line="",rtvalue="";
try{

FileReader f = new FileReader(s);
BufferedReader br=new BufferedReader(f);

while((line = br.readLine())!=null)
{

rtvalue = rtvalue + line;
System.out.println("the file value started");
System.out.println(rtvalue);

}

// txtAfile.setText(rtvalue);
// txtFile.setText(null);
}



kalai

catch(Exception e){
System.out.println(e);
}
}
 
Norm Radder
Rancher
Posts: 1631
21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have a question?
You need to describe your problem!
If you are getting errors, copy and paste them here.
If you're program is not doing what you want it to, write a description of what it is doing and what you want to change. Include examples and output from the program.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!