Find a string in a text file and add something to that line
<p>I have a text file with something like this:</p>

<pre><code>abc&lt;\n&gt;
def&lt;\n&gt;
ghi&lt;\n&gt;
</code></pre>

<p>I want to know how can I add something to a specific line.. the output would be something like:</p>

<pre><code>abc&lt;\n&gt;
def 123&lt;\n&gt;
ghi&lt;\n&gt;
</code></pre>

<p>Search for string "def" and add something to that line.
Thank you</p>
