Skip to main content
Hi,
I would like to replace the texts in my excel list (possibly also different formats).
for example:
in Python it looks like this:
in Attribute "street"

def replace(field):

if"straße" in field:

return field.replace("straße", "str.")

elif"Straße" in field:

return field.replace("Straße","Str.")

elif"strasse" in field:

return field.replace("strasse","str.")

elif"Strasse" in field:

return field.replace("Strasse","Str.")

elif"ä" in field:

return field.replace("ä","ae.")

elif"ö" in field:

return field.replace("ö","oe.")

elif"ü" in field:

return field.replace("ü","ue.")

else:

return field

which transformer should I use, and how? I have no experieces with it.
Thanks

You can use the StringReplacer, and possibly also the StringPairReplacer.


You can use the StringReplacer, and possibly also the StringPairReplacer.

Hi david_r,

 

thanks for reply!

Could you explain me more, pls?

How should I write it? How to edit the parameter?

Thanks


Hi david_r,

 

thanks for reply!

Could you explain me more, pls?

How should I write it? How to edit the parameter?

Thanks

I would start by looking at the manual for these two transformers, it's very well explained there:

https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_Transformers/Transformers/stringreplacer.htm

https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_Transformers/Transformers/stringpairreplacer.htm

If you have further questions, feel free to post them here.