Skip to main content

Is there a way to truncate a list?

 

For example if I have a list of 30 items but only want the first 10 to be kept. I know

I could manually create the list with an attribute creator using _list{0}, _list{1}, _list{2}, etc but just wanted to see if there is a transform or more automated way to do something like this.

 

Regards

 

Dean

Have you looked at ListSlicer from FME Hub?


Hi @deanhowell​ , here is another transformer to try: ListSampler -> First N Elements


Have you looked at ListSlicer from FME Hub?

Thanks @geomancer​ the ListSlicer worked perfectly.


Hi @deanhowell​ , here is another transformer to try: ListSampler -> First N Elements

Thanks @connecter​ I will look into the ListSampler as that looks good also.


Reply