Also,<br> for bestandsnaam in dirs and files:<br>is probably not doing what you want. Use + to concatenate lists.<br><br><br>Daniel<br><br><br><div class="gmail_quote">On Wed, Aug 4, 2010 at 6:30 AM, Mike Kent <span dir="ltr"><<a href="mailto:mrmakent@cox.net">mrmakent@cox.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">On Aug 4, 9:10 am, BobAalsma <<a href="mailto:bob.aal...@aalsmacons.nl">bob.aal...@aalsmacons.nl</a>> wrote:<br>
</div><div class="im">> I'm working on a set of scripts and I can't get a replace to work in<br>
> the script - please help.<br>
<br>
</div><div class="im">> bestandsnaam_nieuw.replace(KLANTNAAM_OUT,KLANTNAAM_IN)<br>
<br>
</div>I'm not sure what you are intending to do here, but string.replace<br>
does not do its replacement in-place. It returns a copy of the<br>
original string, with the replacement done in the copy. You are not<br>
assigning the string returned by string.replace to anything,<br>
therefore, it is immediately thrown away.<br>
<br>
Secondly, and this is just a guess, but since you are doing the<br>
string.replace inside of an os.walk loop, you appear to be trying to<br>
do a filename change. I hope you realize that this will in no way<br>
change the name of the file *on disk*; it will only change it in<br>
memory.<br>
<div><div></div><div class="h5">--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</div></div></blockquote></div><br>