Skip to main content
Question

Create Another Record from Multiple item list

  • November 21, 2012
  • 6 replies
  • 54 views

Apologies for cross posting.

 

 

 

What i'm trying  to achieve is from this Excel table

 

 

-----------------------------------

 

| Name     |  Listed_Item    |

 

-----------------------------------

 

| Mr A     |  [1234]                  |

 

| Mr B     |  [6352], [2344]    |

 

-----------------------------------

 

 

TO

 

 

-----------------------------------

 

| Name     |  Listed_Item |

 

-----------------------------------

 

| Mr A     |   1234               |

 

| Mr B     |   6352               |

 

| Mr B     |   2344               |

 

-----------------------------------

 

 

 

I using StringReplacer to remove the "[ ]". Beyond that, I not sure how to go abt it.

 

If anyone can just point to me the transformers needed to produce this.

 

 

Thanks.
Did this help you find an answer to your question?

6 replies

Hi,

 

 

You might want to use the AttributeSplitter.

 

 

Regards,

 

 


fmelizard
Safer
Forum|alt.badge.img+18
  • Safer
  • November 21, 2012
Hi,

 

After removing the [] and using the attribute splitter as Klaas mentioned, followed it by a list exploder and copying the _list value back to the listed item attribute. you can write it back into a xls.

 

Hope this helps,

 

Itay

 

 

sigtill
Supporter
Forum|alt.badge.img+24
  • Supporter
  • November 22, 2012
Lets see if I can post an FME-workspace directly in this forum. Just Copy-paste this in FME-workspace and - voila you have a suggested solution with StringReplacer.

 

 

Code to Copy-Paste into an FME-Workspace can be found: http://pastebin.com/zUjxh1Rj

 

 

 


  • Author
  • November 23, 2012
Thanks for the pointer guys. i used AttrbuteSplitter and then ListExploder  and it works!

 

 

Thanks again.

fme4fsj
Participant
Forum|alt.badge.img
  • Participant
  • March 25, 2013
I have a similar issue to "qed".  But I need help at the list_exploder and beyond.  Itay says copy "the _list value back to the listed item attribute but I can't figure out how to do that.  So here is my problem:  I have 1150 records in this format

 

 

|Rel_ID|From_road_ID|To_Road_ID|MidCount|Mid_links|

 

|1000|12|89|1|56|

 

|2000|98|21|2|34,45|

 

 

What I want is this:

 

|Rel_ID|Road_ID|Sequence|

 

|1000|12|1|

 

|1000|56|2|

 

|1000|89|3|

 

|2000|98|1|

 

|2000|34|2|

 

|2000|45|3|

 

|2000|21|4|

 

 

So I want to split out the attributes in "MidLinks" add them back as a new record with the original attributes from its record.  I've got AttributeSplitter and List Exploder there but I don't understand why when ListExploder runs it only adds 2 records (there is something I don't fully understand about _list in FME)  and as I mentioned the discussion dropped off before ListExploder was explained fully and SigTil's upload of the workspace example didn't seem to work so now I am lost.

 

 

Could someone continue the discussion re "copying the _list value back to the listed item attribute"?

 


takashi
Influencer
  • April 16, 2017
fme4fsj wrote:
I have a similar issue to "qed".  But I need help at the list_exploder and beyond.  Itay says copy "the _list value back to the listed item attribute but I can't figure out how to do that.  So here is my problem:  I have 1150 records in this format

 

 

|Rel_ID|From_road_ID|To_Road_ID|MidCount|Mid_links|

 

|1000|12|89|1|56|

 

|2000|98|21|2|34,45|

 

 

What I want is this:

 

|Rel_ID|Road_ID|Sequence|

 

|1000|12|1|

 

|1000|56|2|

 

|1000|89|3|

 

|2000|98|1|

 

|2000|34|2|

 

|2000|45|3|

 

|2000|21|4|

 

 

So I want to split out the attributes in "MidLinks" add them back as a new record with the original attributes from its record.  I've got AttributeSplitter and List Exploder there but I don't understand why when ListExploder runs it only adds 2 records (there is something I don't fully understand about _list in FME)  and as I mentioned the discussion dropped off before ListExploder was explained fully and SigTil's upload of the workspace example didn't seem to work so now I am lost.

 

 

Could someone continue the discussion re "copying the _list value back to the listed item attribute"?

 

Once concatenate From_road_ID, Mid_links, and To_road_ID with comma delimitted, and then you can apply the combination of AttributeSplitter and ListExploder.

 


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