Skip to main content

Hi,

Is it possible to sort features by attrbute name? Say I have Excel table with 10 columns, and I need three of them to go to first transformer, and the rest to go to another transformer. Column names are not constant. Or say they named by some order, like Group1tag, Group1kind and so on, how could I filter attributes by a mask 'Group1*'? Thanks,

A test filter based on regx might work for you


A test filter based on regx might work for you

How exactly could I filter by attribute name, not its value?

 

 


Hi @crayxt, if you want to filter features depending on whether specific attributes exist or not, the 'Attribute is Missing' operator for Test Clauses in the Tester or TestFilter might help you. For example, the Tester with this setting routes the input feature to the Passed port if the feature doesn't have at least one of 'Group1tag' or 'Group1kind'.


How exactly could I filter by attribute name, not its value?

 

 

You can use the attribute exploder and then test on the result, but if you are only interested in their existence, the option that @takashi refers too will work without exploding the attributes.

 


@crayxt The AttributeExploder will explode your feature (excel row) and give you a set of features as name/value pairs. You can then sort or filter these based on the <name> and then reaggregate. A little tedious for large datasets but should be OK for excel sized datasets


I have just added an idea for an 'AttributeNameFilter' transformer.

https://knowledge.safe.com/idea/69362/attribute-name-filter.html?


Reply