File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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: 692
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.
I agree. Here's the link:
subject: File Reading
It's not a secret anymore!