Skip to main content
Solved

Easy way to dinamically count number of attribute of feature types

  • February 24, 2017
  • 2 replies
  • 237 views

fmelizard
Safer
Forum|alt.badge.img+19

I'm reading (only for example) a xls file with 3 sheets by reader using "Single merger Feature tipe" option.

So this is result in inspector:

I would like to count number of attribute for each feature type (2 for tab_A_in , 4

for tab_B_in, 3 for tab_C_in) obtainig features with a new "attribute_count" attribute (I don't know obviously first number of feature types and number of attributes so I have to find a dinamic way to obtain result):

Best answer by jdh

If you read the schema you will get one feature per feature type, each with an attribute list, you can then use a ListElementCounter to get the number of attributes.

 

 

You can read the schema using the Schema Reader, or you can use a FeatureReader transformer, and the schema output port.

View original
Did this help you find an answer to your question?

2 replies

jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • Best Answer
  • February 24, 2017

If you read the schema you will get one feature per feature type, each with an attribute list, you can then use a ListElementCounter to get the number of attributes.

 

 

You can read the schema using the Schema Reader, or you can use a FeatureReader transformer, and the schema output port.


fmelizard
Safer
Forum|alt.badge.img+19
  • Author
  • Safer
  • February 27, 2017

Great! Thank you


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings