Skip to main content
Solved

In 2016 How can I rename individual elements of a list?


jdh
Contributor
Forum|alt.badge.img+28
  • Contributor

I often use the AttributeSplitter or other transformers to parse data and rename the resulting list elements as regular attributes.

 

In FME 2015, an AttributeRenamer could point to a specific list element (ie _list{1}) to rename it, this is no longer the case in FME2016.

 

 

Example

 

_list{0}: 45

 

_list{1}: 30

 

_list{2}: 31

 

 

would be renamed to

Degrees: 45

 

Minutes: 30

 

Seconds: 31

Best answer by takashi

The AttributeRenamer still works to rename individual list elements. You can edit the "Input Attribute" column directly. e.g. change "_list{}" to "_list{0}".

View original
Did this help you find an answer to your question?
This post is closed to further activity.
It may be a question with a best answer, an implemented idea, or just a post needing no comment.
If you have a follow-up or related question, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

10 replies

erik_jan
Contributor
Forum|alt.badge.img+17
  • Contributor
  • February 5, 2016

AttributeManager is the transformer to do this.


jdh
Contributor
Forum|alt.badge.img+28
  • Author
  • Contributor
  • February 5, 2016
erik_jan wrote:

AttributeManager is the transformer to do this.

How?

 

The attributeManager allows me to rename the list, but I can't figure out how to rename the elements.

 


erik_jan
Contributor
Forum|alt.badge.img+17
  • Contributor
  • February 5, 2016

See attached images:


takashi
Supporter
  • Best Answer
  • February 5, 2016

The AttributeRenamer still works to rename individual list elements. You can edit the "Input Attribute" column directly. e.g. change "_list{}" to "_list{0}".


takashi
Supporter
  • February 6, 2016
takashi wrote:

The AttributeRenamer still works to rename individual list elements. You can edit the "Input Attribute" column directly. e.g. change "_list{}" to "_list{0}".

I updated an Idea concerning to setting list elements to the Input Attribute column of the AttributeRenamer: Allow Selecting Multiple List Elements for Old (Input) Attribute Column in AttributeRenamer


fmelizard
Contributor
Forum|alt.badge.img+17
  • Contributor
  • February 6, 2016
takashi wrote:

I updated an Idea concerning to setting list elements to the Input Attribute column of the AttributeRenamer: Allow Selecting Multiple List Elements for Old (Input) Attribute Column in AttributeRenamer

We'll dig into this. Sorry @jdh for the complication here. We'll see what we can do in 2016.1


jdh
Contributor
Forum|alt.badge.img+28
  • Author
  • Contributor
  • February 8, 2016
erik_jan wrote:

See attached images:

This creates a second set of attributes rather than renaming the list, which admittedly can be removed once all the attributes have been copied, but is not the most efficient when dealing with large datasets.


erik_jan
Contributor
Forum|alt.badge.img+17
  • Contributor
  • February 8, 2016

In the same AttributeManager after copying the wanted attributes, you can remove the list. You do not need a second transformer to do that.


gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • February 8, 2016

The best answer is actualy not true. And has never been.

The list will not be renamed.

You will be creating a new attribute from the listelement. The selected list attribute is removed from the list.

Check the data inspector, you will see the list is now without the selected element.

The selected element has become an attribute.

U end up with an unbalanced list...appearantly?


jdh
Contributor
Forum|alt.badge.img+28
  • Author
  • Contributor
  • February 8, 2016
gio wrote:

The best answer is actualy not true. And has never been.

The list will not be renamed.

You will be creating a new attribute from the listelement. The selected list attribute is removed from the list.

Check the data inspector, you will see the list is now without the selected element.

The selected element has become an attribute.

U end up with an unbalanced list...appearantly?

In this scenario, that's actually the goal. I want to turn the list into a set of independent attributes.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings