Skip to main content
Solved

Pivot / transpose data in multiple columns into single column to write to a txt file

  • August 3, 2016
  • 3 replies
  • 59 views

Forum|alt.badge.img

Hi there,

I have a table with two columns:

HEADERDATAHEADERDATA

I need to write the information to a txt file which needs to be formatted as:

HEADERDATAHEADERDATA

The headers are all unique.

Any solution is fine - however would appreciate as much information as possible, esp if using Python.

Thanks,

Heather

Best answer by ebygomm

Create an attribute which contains both sets of data separated by a comma, split into a list then explode the list

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.

3 replies

ebygomm
Influencer
Forum|alt.badge.img+46
  • Influencer
  • Best Answer
  • August 3, 2016

Create an attribute which contains both sets of data separated by a comma, split into a list then explode the list


takashi
Celebrity
  • August 3, 2016

Hi @heatha_featha, another thought. You can use the Cloner to create two copies for each record and assign the HEADER and DATA value to a single attribute (text_line_data) according to the copy number (0 or 1), so that they will be written into a text file alternately.


Forum|alt.badge.img

Thanks @egomm and @takashi both solutions work great :)