Skip to main content
Solved

Easy way to dinamically count number of attribute of feature types

  • February 24, 2017
  • 2 replies
  • 287 views

fmelizard
Safer
Forum|alt.badge.img+21

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.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

jdh
Contributor
Forum|alt.badge.img+40
  • 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+21
  • Author
  • Safer
  • February 27, 2017

Great! Thank you