Hi, Replace this line:
str_to_find= "O:\\FAST\\Harmony\\{VERSIONSTRING}"
with:
str_to_find= "O:\\\FAST\\\Harmony\\\{VERSIONSTRING}"
Thanks,
David
David Bender 11501 Burnet Rd. Phone (T/L): 1-512-286-5315
STAF/STAX Development Bldg. 903-5B002 (363-5315)
Austin, TX ITN: 23635315
IBM Software Group, 78758-3400 Email: [email protected]
WPLC
From: Cindy Zhu <[email protected]>
To: "[email protected]"
<[email protected]>
Date: 04/28/2011 05:12 PM
Subject: [staf-users] Replacing a string not working in a stax job
Hi,
I have the following code to replace a string. It used to work before, but
now it is not working any more(the string is not replaced). Can you please
help?
<script>source_include='D:\\Silk\\Apps\\Harmony
\\Include_Harmony.inc'</script>
<stafcmd name="'Check if the automation test finish successfully'">
<location>'local'</location>
<service>'FS'</service>
<request>'GET FILE %s ' % source_include</request>
</stafcmd>
<script>
import re
result=STAFResult
str_to_find= "O:\\FAST\\Harmony\\{VERSIONSTRING}"
str_to_replace="C:/Program Files (x86)/Fekete/Harmony 2011/"
result=re.sub(str_to_find,str_to_replace,result)
outfile='%s/Cindy.inc' % "C:"
txtfh=open(outfile,'w')
</script>
<iterate var="line" in="result">
<script>
txtfh.write(line)
txtfh.close()
</script>
</iterate>
Thanks,
Cindy
[attachment "Include_Harmony.inc" deleted by David Bender/Austin/IBM]
------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network
management toolset available today. Delivers lowest initial
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
staf-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/staf-users
<<inline: graycol.gif>>
<<inline: ecblank.gif>>
------------------------------------------------------------------------------ WhatsUp Gold - Download Free Network Management Software The most intuitive, comprehensive, and cost-effective network management toolset available today. Delivers lowest initial acquisition cost and overall TCO of any competing solution. http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________ staf-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/staf-users
