Skip to main content
Solved

How to re-organize a table using numbered attributes

  • September 11, 2018
  • 2 replies
  • 12 views

olivier
Contributor
Forum|alt.badge.img+7

Hi,

I have a table which is using numbered attributes such as the following (this is a fictitious simplified example):

Id Description LanguageCode0 NotationAlphabet0 NameText0 LanguageCode1 NotationAlphabet1 NameText1 LanguageCode2 NotationAlphabet2 NameText2 1 Park1 FRE Latin Parc Vert DUT Latin Groenpark ENG Latin Green Park 2 Park2 FRE Latin Parc Rouge DUT Latin Roodpark ENG Latin Red Park

In the above situation each park has 3 names, one for each language (FRE, DUT or ENG)

And I need to re-organize it in such a way that it looks like the following:

Id Description LanguageCode NotationAlphabet NameText 1 Park1 FRE Latin Parc Vert 1 Park1 DUT Latin Groenpark 1 Park1 ENG Latin Green Park 2 Park2 FRE Latin Parc Rouge 2 Park2 DUT Latin Roodpark 2 Park2 ENG Latin Red Park

I have tried to achieve this with a ListExpressionPopulator or using the ListPopulator. With the first solution I can get everything into one list but I lose information on the attribute name (LanguageCode, NotationAlphabet,...). Using the ListPopulator it seems this will lead me to having a distinct list for each attribute. But then how can I merge multiple lists into one, keeping in mind that there could be quite many attributes in my real table.

Or do you see other ways of transforming this table?

Thanks in advance for your suggestions!

Olivier

Best answer by takashi

Magical regex!

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

2 replies

takashi
Influencer
  • Best Answer
  • September 11, 2018

Magical regex!


olivier
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • September 11, 2018

Fantastic! Thank you so much @takashi ! This is a very elegant solution to my problem. :-) I had overlooked the power of the BulkAttributeRenamer.


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