Skip to main content
Question

user attribute table - write attribute names and datatypes as rows

  • November 12, 2014
  • 4 replies
  • 54 views

Forum|alt.badge.img+1
In an FME reader under the User Attributes tab it shows a table of the reader's schema with the attribute names and datatypes as rows. What I want to do is to write a table like this to an excel file. In other words I want the attribute names and datatypes as rows not the attribute values themselves. Is there a way to do this?
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.

4 replies

Forum|alt.badge.img
  • November 12, 2014
Hi Daniel, Try this link , you might need a python caller. then use the GetAttribute Method,  Steve

 

 

http://www.techques.com/question/26-27256/FME-values-used-in-python

takashi
Celebrity
  • November 12, 2014
Hi Daniel, the Schema (Any Format) Reader might help you.

 

http://docs.safe.com/fme/html/FME_ReadersWriters/Default.htm#schema/schema.htm

 

Takashi

Forum|alt.badge.img+1
  • Author
  • November 14, 2014
Thanks for the replies. The Schema (Any Format) Reader combined with a ListExploder to give the attribute list gave me exactly what I wanted - Thanks Takashi. I will have to look into using the Python caller sometime as well.

takashi
Celebrity
  • November 14, 2014
Regarding the Python FME Objects API.

 

FMEFeature.getAllAttributeNames method returns a list containing all the attribute names including format attributes.

 

And FMEFeature.getAttributeNullMissingAndType method can be used to know data type of a specific attribute, but it returns a data type identifier interpreted internally by FME, does not return a data type name defined in the source dataset. There is not a simple API method to retrieve data type names defined in a dataset.

 

A possible way is:

 

- create an FMEUniversalReader class instance associated to the format,

 

- call its "open" method to open the dataset,

 

- and then call its "readSchema" method to create features containing schema information as attributes for each feature type in the dataset.

 

It will be a good, interesting challenge to learn more about the API, it's worth to try. But I don't think it's a practical solution in this case.

 

In the actual workspace, I would recommend you to use the Schema (Any Format) Reader.