Solved

BulkAttributeRenamer using list

  • 14 March 2022
  • 9 replies
  • 6 views

Badge

Hi, 

i'm trying to use the to rename the attributes. What i want to to is replace a part of the attributes with the values of a string but nothing seems to happen.

If i use a regular string (f.e. "_1987") it works but if i use the expression @Value(_listJ{0}.J) nothing happens. Is this allowed? can i use a list in the field string?

BulkAttributeRenamer

icon

Best answer by takashi 14 March 2022, 16:03

View original

9 replies

Userlevel 3
Badge +26

Have you tried the 'String Replace' action instead of the 'Regular Expression Replace'?

Badge

Have you tried the 'String Replace' action instead of the 'Regular Expression Replace'?

Yes but sadly i dont get any different result

Userlevel 2
Badge +17

Hi @davidealbertini​ , it should work as expected, but I think the new attribute names won't be exposed, since FME Workbench cannot recognize attribute/list element values when you are creating the workspace.

Try running the workspace with Feature Caching mode and seeing the result in the Feature Information window of FME Data Inspector or Visual Preview.

Badge

Hi @davidealbertini​ , it should work as expected, but I think the new attribute names won't be exposed, since FME Workbench cannot recognize attribute/list element values when you are creating the workspace.

Try running the workspace with Feature Caching mode and seeing the result in the Feature Information window of FME Data Inspector or Visual Preview.

Hi, @Takashi Iijima​, I tried to expose the values in the list and the store them as attribute to follow them and to use them instead of the list element but it seems the transformer still doesnt manage to transform the expression into a string that can be used.

Badge

Hi @davidealbertini​ , it should work as expected, but I think the new attribute names won't be exposed, since FME Workbench cannot recognize attribute/list element values when you are creating the workspace.

Try running the workspace with Feature Caching mode and seeing the result in the Feature Information window of FME Data Inspector or Visual Preview.

@Takashi Iijima​ I just noticed another strange behaviour. If i type a string in the fild "string" of the BulkAttributeRenamer it works perfectly but if i use an expression or a attribute value not only it doesnt work but all the values of the selected attributes go on <missing>...

@Takashi Iijima​ I just noticed another strange behaviour. If i type a string in the fild "string" of the BulkAttributeRenamer it works perfectly but if i use an expression or a attribute value not only it doesnt work but all the values of the selected attributes go on <missing>...

I think the reason why you have observed <missing> is that the selected attributes have been renamed by the BulkAttributeRenamer.

Did you check the resulting feature has what attributes internally with the Feature Information window or the Logger?

See also the attached workspace example which explains simply how the BulkAttributeRenamer works.

Badge

@Takashi Iijima​ I just noticed another strange behaviour. If i type a string in the fild "string" of the BulkAttributeRenamer it works perfectly but if i use an expression or a attribute value not only it doesnt work but all the values of the selected attributes go on <missing>...

Yes you are right. I can actually get the right Attribute after the ExposeAttribute. My problem is now how can I automate the ExposeAttribute if I dont know what is the attribute name going to be?

I dont know what elements are goint to be in the list so I dont know what is the end name of the attributes going to be so how can I expese them?

Thank you, Davide

Userlevel 2
Badge +17

@Takashi Iijima​ I just noticed another strange behaviour. If i type a string in the fild "string" of the BulkAttributeRenamer it works perfectly but if i use an expression or a attribute value not only it doesnt work but all the values of the selected attributes go on <missing>...

Unfortunately there is no way to expose unknown attribute names automatically.

However, you can run the workspace with Feature Caching mode then import from the cached attribute names. It's effective if the source dataset won't be changed. 

attributeexposer-import-from-feature-cache

Badge

@Takashi Iijima​ I just noticed another strange behaviour. If i type a string in the fild "string" of the BulkAttributeRenamer it works perfectly but if i use an expression or a attribute value not only it doesnt work but all the values of the selected attributes go on <missing>...

I understand. Thank you very much. Unfortunately the idea is to have a Workspace that can be used to process datas from different files everytime so the source dataset wont be the same...

Reply