Skip to main content
Solved

I would like to rename a set of attributes (columns) in bulk from a lookup file (csv or xlsx), is this possible? It seems like it should be a fairly simple task, so apologies if this has already been asked.

  • December 15, 2020
  • 3 replies
  • 307 views

I would like to rename a large dataset of many columns using a lookup file (csv or xlsx) - is this possible? I have explored the ..Mapper transformers, but am unable to get them to work in this way. The only method that appears possible at the moment is through the AttributeRenamer, but am finding this rather tedious entering one by one. The Import facility on this transformer only appears to name Input and Output Attributes with the same names when I use it.

Happy to be corrected in my use of this transformer!

The column name lookup I have structured in a spreadsheet as below;

Capture

Best answer by david_r

There's the SchemaMapper (which I guess you've looked at?) that was more or less invented for this purpose, but it's not the simplest transformer, I'll admit. There is a very helpful tutorial that's pretty much mandatory reading, I'd say: https://community.safe.com/s/article/schemamapper-transformer-tutorial

After the SchemaMapper you could follow up with a SchemaSetter (from the FME Hub) and finally a dynamic CSV or Excel writer.

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

3 replies

david_r
Celebrity
  • Best Answer
  • December 15, 2020

There's the SchemaMapper (which I guess you've looked at?) that was more or less invented for this purpose, but it's not the simplest transformer, I'll admit. There is a very helpful tutorial that's pretty much mandatory reading, I'd say: https://community.safe.com/s/article/schemamapper-transformer-tutorial

After the SchemaMapper you could follow up with a SchemaSetter (from the FME Hub) and finally a dynamic CSV or Excel writer.


  • Author
  • December 15, 2020
david_r wrote:

There's the SchemaMapper (which I guess you've looked at?) that was more or less invented for this purpose, but it's not the simplest transformer, I'll admit. There is a very helpful tutorial that's pretty much mandatory reading, I'd say: https://community.safe.com/s/article/schemamapper-transformer-tutorial

After the SchemaMapper you could follow up with a SchemaSetter (from the FME Hub) and finally a dynamic CSV or Excel writer.

That is very helpful thank you, having a quick look at the tutorial it appears as though I need to restructure my lookup table to make use of keywords that FME would recognise - not super intuitive without looking at the help - but it should work. Thanks for your assistance David! I did look at the help pages, but did not come across the link you have forwarded, so this will save a lot of time - very much appreciated!


david_r
Celebrity
  • December 15, 2020
jimbo wrote:

That is very helpful thank you, having a quick look at the tutorial it appears as though I need to restructure my lookup table to make use of keywords that FME would recognise - not super intuitive without looking at the help - but it should work. Thanks for your assistance David! I did look at the help pages, but did not come across the link you have forwarded, so this will save a lot of time - very much appreciated!

I agree about the SchemaMapper, it's one of those "old" transformers that really demands that you understand how it works before using it.

If you're stuck with a transformer it can often help to just search for the transformer name here: https://community.safe.com/s/documentation

If you search for SchemaMapper, that article is the first one that pops up.


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