Question

A ridiculous problem

  • 9 February 2014
  • 3 replies
  • 9 views

This seems to me to be quite a ridiculous problem, but I can't find a way to solve it. I have an attribute that comes from an Apache 2.2.25 API connected through a HTTPFetcher that I need to split into a number of new attributes. This is an exapmle of the attribute with the kind of data it contains (alsways numbers of vaying lenght separated by "/"):

 

 

Attribute X

 

12345

 

12345/123456

 

12345/123456/12345

 

123456/12345

 

 

What I need is this result:

 

Attribute X                           AttributeNew1      AttributeNew2      AttributeNew3

 

12345                                 12345                    <blank>                 <blank>

 

12345/123456                  12345                    123456                  <blank>

 

12345/123456/12345      12345                    123456                 12345

 

123456/12345                   123456                  12345                   <blank>

 

 

What I get now is this:

 

Attribute X                           AttributeNew1      AttributeNew2      AttributeNew3

 

12345                                 <blank>                 <blank>                 <blank>

 

12345/123456                  123456                  <blank>                 <blank>

 

12345/123456/12345      123456                 12345                    <blank>

 

123456/12345                   12345                   <blank>                 <blank>

 

 

In other words, the splitter does not transfer the first value to a new attribute. I've been trying a lot of different approaches without any luck. Ant ideas on what to do?

 

 

Thank you!

 

 

Chris

3 replies

Userlevel 4
Badge +13
Hi,

 

the results of the splitter are stored in a list, you can copy the list element values into new attribute values or explode it to new features.

 

 

Userlevel 2
Badge +17
Hi,

 

 

Itay is right. Try splitting the attribute value at slash (AttributeSplitter), and renaming individual list elements (AttributeRenamer).

 

_list{0} --> AttributeNew1

 

_list{1} --> AttributeNew2

 

_list{2} --> AttributeNew3

 

 

Takashi
Of course! There can be up to 50 numbers in that attribute, so my list gets pretty long. Now I see that i startet the renaming at _list{1} instead of _list{0}. I knew this was a ridiculous problem. :) Thank you both for the feedback!

 

 

Chris

Reply