AnsweredAssumed Answered

Replacing text in txt files

Question asked by n.ueberschaeresri-rw-esridist Employee on Sep 15, 2017
Latest reply on Sep 16, 2017 by n.ueberschaeresri-rw-esridist

I am replacing square brackets by round brackets with help of a python script - works perfectly. 

But I also want to replace a single word by another word (Cruise -> Campaign): nothing happens. 


Here is the part of the script: 


r = csv.reader(t, delimiter="\t")
for fields in header:
fields.replace("Cruise","Campaign")##not working
fields.replace("[", "(")
fields.replace("]", ")")


Any idea why it replaces the brackets fine but not the word?