Solved

Reading feature attributes from varying Excel with FeatureReader

  • 3 March 2021
  • 5 replies
  • 20 views

Userlevel 1
Badge +22

Hi list.

This issue has been touched on several times, but I don't see a solution for me in any of the answers.

I have to read a number of Excel spreadsheets, and being spreadsheets, they vary very much in both content and structure.

I can read the spreadsheets with FeatureReader just fine, and I get both schema features with an attributes{} list of attributes, and generic data features with attributes in an unexposed state.

How do I utilize the schema features to dynamically expose whatever attributes are present in the data ?

Exposing attributes seems to be a design time issue only, and I haven't found any way to expose attributes dynamically.

Alternatively, can a (MS/SQL) writer accept a list of name/value items, and output these to the database as fields with values ?

I also need to merge several fme_feature_type's (i.e. multiple Excel sheets/tabs), so Dynamic Schema Definition won't work for me, I think.

Cheers.

icon

Best answer by lifalin2016 24 June 2021, 13:27

View original

5 replies

Badge +2

Hi,

When you know that attribute name, why do you want to expose dynamically instead of using attribute exposer?

Userlevel 1
Badge +22

Hi,

When you know that attribute name, why do you want to expose dynamically instead of using attribute exposer?

Please read it again. I do _not_ know the attribute names on design time, and thus cannot use AttributeExposer.

Userlevel 6
Badge +33

I'm also not sure what you need exactly. Yes you can read excel files in a dynamic way. What do you want to do with the data after reading?

Userlevel 1
Badge +22

I'm also not sure what you need exactly. Yes you can read excel files in a dynamic way. What do you want to do with the data after reading?

It quite simple: I want to read any Excel spreadsheet, and store whatever fields are embedded in them to a MS/SQL database table.

This requires exposing of the dynamic attributes, afaik. This is not done automatically by FeatureReader, and I can't do it design time, as the attributes are unknown at that time.

The thing about multiple tabs are, that sometime the attribute data is divided into multiple tabs with the row id being the key to stitching them together.

Maybe it cannot be done?

Userlevel 1
Badge +22

I'm closing this question. I found that the better approach is to handle it using schema features.

Reply