Visidata: Feature request: implode specified field values rows, in cells

Created on 11 Nov 2019  路  3Comments  路  Source: saulpw/visidata

Hi,
sometime it is very useful to implode values vertically, from something like

field value
A     5
A     3
B     3
C     5
C     3

to

field value
A     5;3
B     3
C     5;3

It would be great to add this feature to melt and pivot.

Thank you

bug

All 3 comments

Hi @aborruso, you can use the Frequency Table for this:

  1. Add the list aggregator to the value column.
  2. Open the Frequency Table on field column.
  3. Add an expression column to join the values: =';'.join(value_list)

Maybe the last step could be made into a command called addcol-joinvals on z( or something.

[The list aggregator has been added since 1.5.2, so it is not officially released yet].

@saulpw thank you

To have addcol-joinvals on z( would be great, because it's another "classic" data transformation "job".

If you think it's useful for vd, what about to leave this issue open and add to it the label "feature request"?

@saulpw
Please add addcol-joinvals command, I think it's very useful

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wurosh picture wurosh  路  3Comments

zaiste picture zaiste  路  4Comments

aborruso picture aborruso  路  3Comments

baogorek picture baogorek  路  3Comments

paulklemm picture paulklemm  路  4Comments