Skip to content

What's the best way to select the first (or last) row in each group? #929

Answered by saulpw
ghost asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @DAVIDWALES, this is a good question. I can't think of an easy way to do this with stock VisiData, but you can add a simple command to the freq table to do what you want:

FreqTableSheet.addCommand('', 'select-source-first', 'for r in rows: source.select([r.sourcerows[0]])')

You can bind it to a keystroke if you want, or use Space to execute select-source-first without binding it.

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@ghost
Comment options

@saulpw
Comment options

Answer selected by saulpw
Comment options

You must be logged in to vote
1 reply
@ghost
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants