Replace A Line Or Word In A File - Online Code


To replace a word or words or complete line in an existing file with a new word or words or lines, the following programme helps to achieve it.

Source Code


public class BTest


  public static void main(String args[])




      File file = new File("file.txt");

      BufferedReader reader = new BufferedReader(new FileReade
... (login or register to view full code)

To view full code, you must Login or Register, its FREE.

Hey, registering yourself just takes less than a minute and opens up a whole new GetGyan experience.


No comment yet. Be the first to post a comment.