Modifying .txt from Python
<p>I am writing a simple program that offers the user an account. That includes that the user can change his or her password over and over. And if he or she includes info as their telephone number, there must be options that enable them to change their own data.</p>

<p>The program will open <code>.txt</code> files and read the info.</p>

<p>For example, this is a small part of the info that the <code>.txt</code> includes:</p>

<pre>
123$333$Harold$321$Far far away3
124$444$George$654$Far far away4   #I logged in with this account
125$555$Louis$987$Far far away5
</pre>

<p>Now suppose that George (the one who logged in) wants to change his adress. I mean it is easy to modify the info once it is on the list, split by the "$". This is how the modified list will look like:</p>

<pre><code>[124, 444, 'George', 654, '22 Acacia Avenue']
</code></pre>

<p>But the question is how can I modify the <code>.txt</code> so that the contents will look like this?</p>

<pre>
123$333$Harold$321$Far far away3
124$444$George$654$22 Acacia Avenue   
125$555$Louis$987$Far far away5
</pre>

<p>How can I achieve this?</p>
