Skip to main content
Solved

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


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

View original
Did this help you find an answer to your question?

3 replies

ebygomm
Influencer
Forum|alt.badge.img+31
  • 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
Contributor
Forum|alt.badge.img+21
  • Contributor
  • 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 :)


Reply


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