• 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
Bartender
Posts: 1526
14
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic