How can I find and replace text after a specific character on each line in Python?
<p>I have multiple files with lines as below and need to cycle through and find and replace "TEXT" but only after the "="</p>

<p><em>static.TEXT.here=change.TEXT.here</em></p>

<p>This is my current code but I'm hitting my head against the wall to specify only after "=" as the "TEXT" needing replacement is not in a consistent position across all files</p>

<pre><code>import re
src = open(r"sourcefile.txt").read()
dest = open(r"destinationfile.txt","w")
dest.write( re.sub(currentText,replacementText,src, flags=re.I) )
dest.close()
</code></pre>

<p><strong>EDIT</strong></p>

<p>I have taken a slightly different approach and imported csv and used the '=' as a delimiter to create separate rows but am now having difficulty itegrating my existing re.sub code to find and replace the text, code I am using to relevant row:</p>

<pre><code>import csv
with open("sourcefile.txt", 'rb') as csvfile:
csvreader = csv.reader(csvfile, delimiter= '=')
for row in csvreader:
    if len(row) &gt;1:
        print row[1]
</code></pre>