Dear Subash,
I can see that you have completely gone off the path. I will edit your code to what you need and thereafter explain it:
First of all, toString() method of any clas returns a description about the class or something of that sort. So, in this case toString() method should not be used.
Java provides funtionality to read one line at a time from a file. In the case of BufferedReader it is readLine(). It throws IOException.
So first
you should read a line from the file and assign it to the data variable like this:
Then you should check the value of data. If it is null then the end of file has reached otherwise a single line has been returned. Now check whether this line contains the required String with the help of
indexOf() method of String class.
If the value returned is -1 then the line does not contain the required String otherwise a positive value will be returned.
Then replace all the occurances of the required String within that line by simply calling
replaceAll() method of String class.
To cycle through all the lines use a loop. Preferably a while loop.
NOTE: DON"T FORGET TO AGAIN ASSIGN ANOTHER LINE TO data variable usong readLine() method otherwise the loop will run infinitely.
Hope this helps you.