Skip to main content
Solved

Combine 2 lines of header into 1 attribute name from Excel

  • March 25, 2022
  • 2 replies
  • 134 views

mapixse
Contributor

I'd like to combine headers from 2 lines in Excel to form 1 attribute name.

excelShould result in feature with attributes ID, AAA_XXX and BBB_YYY

I've looked at debbiatsafe solution at Bulk Rename Attributes with Original Name plus the First Row (safe.com) but that doesn't do it all the way.

Need to have the features with the attribute names to continue working with in the workspace.

Any hints on how to proceed?

 

Best answer by hkingsbury

I've attached an example which is basically the solution you linked.

The thing to note in this scenario, is that FME only know the schema of the data as you specified in the reader and when you explicitly set known attribute values. When creating a new attribute using attribute values you are using an unknown value so FME doesn't know what this new attribute is called until you run the process.

 

The table in the data inspector will only show exposed values. However if you look at the Feature Information panel, you will see many more attributes, including the ones that were made at runtimeimage 

To use these new attributes, you need to create a schema with them in it. This can then be passed to you're writing and written out

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

hkingsbury
Celebrity
Forum|alt.badge.img+63
  • Celebrity
  • 1625 replies
  • Best Answer
  • March 27, 2022

I've attached an example which is basically the solution you linked.

The thing to note in this scenario, is that FME only know the schema of the data as you specified in the reader and when you explicitly set known attribute values. When creating a new attribute using attribute values you are using an unknown value so FME doesn't know what this new attribute is called until you run the process.

 

The table in the data inspector will only show exposed values. However if you look at the Feature Information panel, you will see many more attributes, including the ones that were made at runtimeimage 

To use these new attributes, you need to create a schema with them in it. This can then be passed to you're writing and written out


mapixse
Contributor
  • Author
  • Contributor
  • 7 replies
  • March 29, 2022

Thank you, that seems to solve it.