Replacing text in a text file
I need to be able to search and replace a line in a text file. Searching shouldnt be too hard to do, however, how do I replace all the text in a certain line.**Snippets of code are preferred, as well a web-site tutorials.Thanks in advance, Steven1350
Read the file, for each line, either write it out as-is to a temp file or modify it in memory (for example, with String.replaceAll()), and then write it out. When done, remove the original and rename the temp file to the original name.