I\'m writing a small method to replace some text in a file. The only argument I need is the new text, as it is always the same file and text to be replaced.
I\'m hav
Maybe some indentation problem?
The following works correctly:
import os
def updateExportConfigId(id):
stringId = "%s" % id
cmd= "sed '1,$s/MANAGER_ID=[0-9]*/MANAGER_ID=" + stringId + "/g' test.dat > test.new"
print "command is " + cmd
os.system(cmd)
updateExportConfigId("adsf")
Also do not use reserved words (id
) as variables.