how to modify some of the contents of the file and save in the same file using java
<p>I have a text file of words and their frequency count. When I give any word, which matches with a word in text file, then I need to increment its frequency count. How to change the values in the text file? How to do this process in Java. Please suggest any ideas. Thanks in advance.</p>

<pre><code>myfile.txt

word    4
self    5
defence 3
argue   7
</code></pre>

<p>When I give the word "self", then in the same text file of "myfile.txt", it need to overwrite as </p>

<pre><code>word    4
self    6
defence 3
argue   7
</code></pre>
