Skip to main content
Open

Improved List Handling/Functionality

Related products:Transformers
  • July 7, 2020
  • 2 replies
  • 68 views

dbaldacchino1
Enthusiast
Forum|alt.badge.img+14

I often find myself needing to do certain things on list members such as removing or extracting the first/last element, or extracting/removing the nth elementh, reversing the list, etc. It would be great to have a transformer that allows these types of operations so you can manipulate list data easily (spoken by someone that doesn't do Python for a living!). I have also found one of @takashi's custom transformers (ListSampler) that is sometimes useful, but doesn't have the options I use most in the Sampler such as "Last Nth Element", which would be a great workaround to drop the last element in a list by picking the unsampled output. Thanks!

2 replies

Forum|alt.badge.img+2

@dbaldacchino1 there are some gaps in FME list transformers. @takashi as contributed many list manipulation transformers to FME HUB, as you've discovered. I think the ListSlicer is close to what you're looking for in this case.

If one of these custom transformers doesn't quite meet your needs, then leave a comment on the HUB transformer. Authors are usually very happy to add new options if they are needed


dbaldacchino1
Enthusiast
Forum|alt.badge.img+14
  • Author
  • Enthusiast
  • July 8, 2020

Thanks for the heads up @markatsafe! Another little gem by @takashi :) Yes I think in combination with a ListCounter, you can use count-1 as the "Number of Elements to Slice" input to drop the last element in lists of variable size.