Skip to main content
Dear FME community,

 

 

I have several attribute names with (german) special signs which I want to rename. For example:

 

 

gefällt -> gefaellt

 

Fälldatum -> Faelldatum

 

Höhe --> Hoehe

 

 

The "ä" and "ö" should be replaced with "ae" or "oe" so that the resulting attribute (after -->) will be gefaellt, Faelldatum and Hoehe.

 

 

A solution for changing attribute values was already posted here:

 

https://knowledge.safe.com/AnswersQuestionDetail?id=906a0000000d1MEAAY&s=2& (https://knowledge.safe.com/AnswersQuestionDetail?id=906a0000000d1MEAAY&s=2&)

 

 

One possible way was: Create an attribute with the AttributeCreator and then use:

 

@Evaluate( 

 

But how can I change the attribute names itself? Is there a way to do it with the BulkAttributeRenamer? It has a regular expression replacement, so I think it might be possible to use this.

 

 

Any suggestions are welcome. Many thanks!

 

 

Kind regards

 

Thomas
Hi

 

 

I agree that the BulkAttributeRenamer might be the best solution.

 

 

David
Hi David,

 

 

the BulkAttributeRenamer works. But the thing is that I have do use many instances of it, one transformer for each special sign (e.g. ae, oe,...) with the following settings:

 

 

 

 

Is there a way to use the "Regular Expression Replace" option in order to use just one transformer for all special sign (ä --> ae, ö --> oe, ...). What do I have to enter here in "Text to find" and "String"?

 

 

 

 

Kind regards

 

Thomas
Hi

 

 

Unfortunately you do not have the functionality of the StringPairReplacer in the BulkAttributeRenamer. However, you can group some character replacements like this:

 

 

 

 

This will replace either "à" or "ä" with "a". The key is knowing that the entire String parameter is always used.

 

 

Also, I'd consider taking your series of BulkAttributeRenamers and put them in a custom transformer.

 

 

There is an alternative way, though, adapting the PythonCaller code I posted earlier here: https://knowledge.safe.com/AnswersQuestionDetail?id=906a0000000ckT7AAI

 

The downside is that the renamed attributes won't be visible in the workspace when you design it, as the Python code only executes at run-time.

 

 

David

Reply