Question

Attribute names to values in a single new attribute

  • 17 November 2017
  • 5 replies
  • 69 views

Badge +2

I like to have all the attribute names as values in a new attribute.

 

Tried different solutions, but nothing worked so far.

 

Looking for some suggestions.

 

Maybe a simple question, but I can't get it right...

 

 

source table with attribute names:

 

[aaa] | [bbb] | [ccc]

 

1233 | 4322 | 2343

 

1231 | 9584 | 7123

 

 

target:

 

[id] | [names]

 

1 | aaa

 

2 | bbb

 

3 | ccc

 


5 replies

Userlevel 2
Badge +16

Have you tried the Schema reader?

That will list all attributes.

Simply add a counter for the ID field.

Badge +2

Have you tried the Schema reader?

That will list all attributes.

Simply add a counter for the ID field.

I'm using version 2016 right now... : no Schema reader transformer there. Possibly the Schema output from the Feature reader?

 

 

I already used the AttributeExploder creating a list, concatenated the list, used then the attributesplitter, and tried also the stringsearcher, but all without the desired results...

 

 

 

Userlevel 4
Badge +25
I'm using version 2016 right now... : no Schema reader transformer there. Possibly the Schema output from the Feature reader?

 

 

I already used the AttributeExploder creating a list, concatenated the list, used then the attributesplitter, and tried also the stringsearcher, but all without the desired results...

 

 

 

I'm 99% sure that the schema reader should be older than 2016. Check out Tools > Reader and Writer Gallery and see if it shows up there. There should be two: Schema (Any Format) and Schema (From Table). The "Any Format" one is the one to use here.

 

 

NB - it's a format, not a transformer.

 

Userlevel 2
Badge +17

Have you tried the Schema reader?

That will list all attributes.

Simply add a counter for the ID field.

"Schema reader" is not a transformer. Find "Schema (Any Format) Reader" in the Reader Gallery.

 

The schema feature from the Schema port of the FeatureReader should also be used here. Try extracting "attribute{}.name" with the ListExploder.
Badge +2

that did the trick.

 

Already I thought that there should be something like that

 

Thanks @erik_jan and @takashi !

Reply