Solved

attribute split issue

  • 14 April 2020
  • 4 replies
  • 4 views

Hi All,

I am trying to split the attribute in the text string, which has old and new attributes with same id and then make selection for specific attributes like surface ,highway. Final action is to create the column for each split attribute . Attribute listed in the text string are different every time and not in sequence so i am not sure how i can create columns dynamically. screenshot of the input data

Tried solutions : I have tried to do this using the attribute splitter and list expolder and then extracting attribute per columns but now i am getting too many columns for each id.

can somebody suggest ?

icon

Best answer by markatsafe 15 April 2020, 19:25

View original

4 replies

Badge +2

@dandekarpriya after your AttributeExploder try the AttributeCreator and in the New Attribute column use the Attribute Value option:

this allows you to take name/value pairs and create the attribute with the name. The new attributes won't appear in the workbench schema, but you should see them in the Data Inspector Feature Information Window.

 

If you attach a small sample dataset someone might make you an example workspace.

@dandekarpriya after your AttributeExploder try the AttributeCreator and in the New Attribute column use the Attribute Value option:

this allows you to take name/value pairs and create the attribute with the name. The new attributes won't appear in the workbench schema, but you should see them in the Data Inspector Feature Information Window.

 

If you attach a small sample dataset someone might make you an example workspace.

@markatsafe i tried that but still i have attributes in different columns . here is the screenshot of the WB that i have.

 

Also i am attaching the data in zip file with name test data. test_data.zip

Badge +2

@dandekarpriya thanks for including the small sample dataset. It's a big help to get a sample of data that contributors can experiment with.

I'm not sure what you want to do with the multi-part values turn - lanes:backward: left|right - so I split them on the last ':' -

turn:lanes:backward left|right

The workspace looks like this:

I've attached an example (FME 2019.2): splitattributes.fmwt

@dandekarpriya thanks for including the small sample dataset. It's a big help to get a sample of data that contributors can experiment with.

I'm not sure what you want to do with the multi-part values turn - lanes:backward: left|right - so I split them on the last ':' -

turn:lanes:backward left|right

The workspace looks like this:

I've attached an example (FME 2019.2): splitattributes.fmwt

Thank you @markatsafe.

I build something like this . attached is the screen shot of the same .

Reply