Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

urgent help needed

 
padma patil
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am trying to implement search and replece function of notepad in Java.
1)can anybody explain me / give an idea of, how to search for a text in a file. is there any fseek command for searching or I need to read the line(readln()) and serach word by word?
2) Once I find the text wanted to replace the text with new text and store it in the file.
how can implement this?
I really appreciate your feedback.
Thanks,
padmashree
 
Shiva Kumar
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
Try to Use StringBuffer Class. That class contains replace() method that will help you.
Use String Class to identify the index of the search String and replace that String with your newString in StringBuffer Class.
Just Try that. If you need any help please let me know.
Shiva.
 
What a show! What atmosphere! What fun! What a 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!