Skip to main content
I have a table of data that has two fields that have comma separated values in them. Each value is related to each other. So the first comma separted value in Neighbour Code field is related to the first comma separated value in Neighbour Angle field and so on.... The table looks like this

 

 

 

 

How do I separate these values and create a new record for each value in the fields so the table would look like this:

 

 

 

 

Thanks 

 

Matt

 

 

 
Hi Matt,

 

 

I think this data flow is a basic solution.

 

 

Notes:

 

"Neighbour Angle" should be removed in the upper flow, not to conflict with Supplier's "Neighbour Angle" at the FeatureMerger.

 

"Conflict Resolution" parameter of the ListExploders should be set to "Use Incoming List".

 

 

In addition, the PythonCaller may also be effective in this case.

 

-----

 

# Python script example

 

class FeatureProcessor(object):

 

    def input(self, feature):

 

        codes = str(feature.getAttribute('Neighbour Code')).split(',')

 

        angles = str(feature.getAttribute('Neighbour Angle')).split(',')

 

        for c, a in zip(codes, angles):

 

            f = feature.clone()

 

            f.setAttribute('Neighbour Code', c)

 

            f.setAttribute('Neighbour Angle', a)

 

            self.pyoutput(f)

 

-----

 

 

Takashi

Reply