This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes File Reading Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "File Reading" Watch "File Reading" New topic

File Reading

kalai sundar
Ranch Hand

Joined: May 25, 2005
Posts: 69
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="";

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");


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


catch(Exception e){
Norm Radder
Ranch Hand

Joined: Aug 10, 2005
Posts: 691
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.
jQuery in Action, 3rd edition
subject: File Reading
It's not a secret anymore!