Solved

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

  • 3 August 2016
  • 3 replies
  • 10 views

Badge

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

icon

Best answer by ebygomm 3 August 2016, 10:38

View original

3 replies

Userlevel 1
Badge +21

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

Userlevel 2
Badge +17

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.

Badge

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

Reply