I guess you can use Attribute Manager for this. Create new Output Attribute value as "single attribute sahpe" and add in "Attribute Value" like below.
@Value(shape{0}) @Value(shape{1}) @Value(shape{2})
I hope it will work.
In a dynamic scenario, where you don't know the names of the lists, I can't think of a way to do this other than via scripting.
Something along the lines of
import fme
import fmeobjects
import re
def processFeature(feature):
# get all the unique list names
rootNames =set()
attrList= feature.getAllAttributeNames()
for attr in attrList:
list = re.search('(.*){o0-9]*}(.*)', attr)
if list:
listName = list.group(1)+"{}"+list.group(2)
rootNames.add(listName)
#get the values for each unique list and concatenate them
for listAttr in rootNames:
listVal = feature.getAttribute(listAttr)
concatVal = ','.join(listVal)
newAttr = listAttr.replace('{}','')
#add the attribute to the feature
feature.setAttribute(newAttr, concatVal)
There is an existing enhancement request for this behaviour. It's PR#15122 - the low number tells you how old that request is. Sadly I don't think there have been a lot of requests. But I will add a link to this thread and see if I can increase the priority.
@jdh
Great - your python script does the trick. Thanks a lot!!!!!
Thanks to the others as well-
There is an existing enhancement request for this behaviour. It's PR#15122 - the low number tells you how old that request is. Sadly I don't think there have been a lot of requests. But I will add a link to this thread and see if I can increase the priority.
Arrived here this morning after thinking there must be an alternative to many listconcatenators or a python script but seems not, I thought it was just lack of coffee and my brain not being awake!