Skip to main content
Solved

Each column value in separate row

  • March 24, 2020
  • 4 replies
  • 24 views

I am new to FME and I wish to make the following transformation.

From:

IDColAColBColC1A1B1C12A2B2C23A3B3C34A4B4C45A5B5C5

 

To:

IDColumnNameValue1ColAA11ColBB11ColCC12ColAA22ColBB22ColCC23ColAA33ColBB33ColCC34ColAA44ColBB44ColCC45ColAA55ColBB55ColCC5

 

Can anyone help me out?

Best answer by ebygomm

AttributeExploder, keep Attributes set to Yes, followed by a tester to get rid of the format attributes and an attribute keeper to keep only the ID, attribute name and attribute value

 

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

4 replies

ebygomm
Influencer
Forum|alt.badge.img+45
  • Influencer
  • Best Answer
  • March 24, 2020

AttributeExploder, keep Attributes set to Yes, followed by a tester to get rid of the format attributes and an attribute keeper to keep only the ID, attribute name and attribute value

 


  • Author
  • March 25, 2020

AttributeExploder, keep Attributes set to Yes, followed by a tester to get rid of the format attributes and an attribute keeper to keep only the ID, attribute name and attribute value

 

Thanks a lot!

For a more generic approach for handling different CSV files, I've altered the Tester to:


ebygomm
Influencer
Forum|alt.badge.img+45
  • Influencer
  • March 25, 2020

Thanks a lot!

For a more generic approach for handling different CSV files, I've altered the Tester to:

Yes, it's a pity that you cannot choose to ignore unexposed/format attributes when exploding

You can vote for it here

https://knowledge.safe.com/idea/19187/option-to-select-attributes-that-should-not-be-exp.html


drandall
Participant
Forum|alt.badge.img+1
  • Participant
  • April 10, 2025

Add a PythonCaller with the following def input() section:

def input(self, feature: fmeobjects.FMEFeature):
        attrs = feature.getAllAttributeNames()
        for i, attr in enumerate(attrs):
            attribute_feature = fmeobjects.FMEFeature()
            attribute_feature.setAttribute('field_order',i)
            attribute_feature.setAttribute('field_name',attr)
            attribute_feature.setAttribute('example_data',feature.getAttribute(attr))
            self.pyoutput(attribute_feature)
        pass

 

Attributes to expose: field_order field_name example_data

Attributes to hide: [SELECT ALL]