Visidata: [wishlist] Create new column from row index

Created on 7 Feb 2020  路  4Comments  路  Source: saulpw/visidata

How can I add a new column involving the current row index?

For example from

| Brands |
| - |
|聽Mazda |
| Mercedes |
| BMW |

to

| Brands | ID |
| - | - |
| Mazda | 1 |
| Mercedes | 2 |
| BMW | 3 |

This is probably already trivial. Maybe we can add an example here: https://jsvine.github.io/intro-to-visidata/intermediate/creating-new-columns/

question

Most helpful comment

@paulklemm if you're willing to switch to the develop branch, there's a plugin that does that, rownum.
If you install the plugin, then all you have to do is [space]addcol-rownum[enter]

All 4 comments

Hi @paulklemm you could do in this way https://github.com/saulpw/visidata/issues/215#issuecomment-443544587

@paulklemm if you're willing to switch to the develop branch, there's a plugin that does that, rownum.
If you install the plugin, then all you have to do is [space]addcol-rownum[enter]

Thanks so much @aborruso and @sfranky for thoroughly answering the question. <3 :blush:

And yes, @paulklemm, it would definitely be good to document this. I will add it to our docs at least. This is intro to visidata's repo: https://github.com/jsvine/intro-to-visidata

Was this page helpful?
0 / 5 - 0 ratings

Related issues

unhammer picture unhammer  路  3Comments

geekscrapy picture geekscrapy  路  3Comments

Mikee-3000 picture Mikee-3000  路  4Comments

pigreco picture pigreco  路  3Comments

paulklemm picture paulklemm  路  4Comments