Skip to main content
Question

Attribute names to values in a single new attribute

  • November 17, 2017
  • 5 replies
  • 249 views

harmen_kampinga
Forum|alt.badge.img+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

erik_jan
Contributor
Forum|alt.badge.img+17
  • Contributor
  • November 17, 2017

Have you tried the Schema reader?

That will list all attributes.

Simply add a counter for the ID field.


harmen_kampinga
Forum|alt.badge.img+2
erik_jan wrote:

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...

 

 

 


mark2atsafe
Safer
Forum|alt.badge.img+43
  • Safer
  • November 17, 2017
harmen_kampinga wrote:
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.

 


takashi
Contributor
Forum|alt.badge.img+19
  • Contributor
  • November 17, 2017
erik_jan wrote:

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.

harmen_kampinga
Forum|alt.badge.img+2

that did the trick.

 

Already I thought that there should be something like that

 

Thanks @erik_jan and @takashi !

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