visidata

Table of Contents

1. Basic usage

1.1. Concepts

1.1.1. Sheets

Understanding Sheets — An Introduction to VisiData

  • Source sheets
  • Derived sheets
  • Meta sheets
    • Sheet sheet : SHFT+S
    • Column sheet : SHFT+C

1.2. Operations

  • Menu: CTRL+h
  • Abort: CTRL+c
  • Save: CTRL+S (Doing editing does not save)
  • Copy: gY
  • Undo: SHFT+U
  • Redo: SHFT+R
  • Quit
    • Quit sheet: q
    • Graceful quit: gq
    • Quit visidata: CTRL+q (force)

1.3. Navigation

  • Highlight current: CTRL+g
  • hjkl / g(hjkl)
  • Page Down: CTRL+F
  • Page Up: CTRL+B

1.4. Search

  • Forward: / or g/ or z/
  • Backward: ? or g? or z?
  • Match: n (next match), N (previous match)

1.5. Editing

  • e, CTRL+e (end), CTRL+a (start)
  • Move columns & Rows: SHFT+(HJKL)

1.6. Rows

  • Selection
    • Select: s / gs
    • Unselect: u / gu
    • Toggle select: t / gt
  • Sorting: [ and ]
  • Selection by patterns
    • Select match
      • | + term (current column)
      • , : Shorthand to select rows where current column match row’s value for that column
      • g| + term (any column)
    • Unselect match
      • \ + term (current column)
      • g\ + term (any column)
  • Select by Python expression
    • z| : Then type in python expr

1.7. Columns

NOTE: Most of these edits can be made from the Column Sheet too.

  • Assign Data Types
    • When sheet is open, go to the column and press
      • #, %, $ (currency), @ (date), ~
      • or z~ to undo datatype change for a column
  • Pin/Key column: ! but useful if you
  • Rename column: ^
  • Hides column: - (0 width)
  • You can also change the widths etc
    • z- : Half width
    • g_ : expand width of all columns (auto adjust)

1.7.1. Create columns

  • za : new column
  • i : add increment column
  • = and then Python expr: Create new column with expression. Eg HEIGHT >= 100
  • : : Press : and the delimiter, we'll have n number of columns based on the specified delimiter.
  • ; : Press : and the regex with capture group.

1.8. Summarization

  • Frequency: SHFT+F
    • Multi-Column: First key the column(s) using !, then gF (Eg. Year and Publisher Groupby)
  • One off calculations
  • Describe sheet: Shift+I

1.8.1. Aggregations

  • When doing frequency with SHFT+F, we can do aggregations/groupby by other numeric columns also.
  • Fist make sure the column has numeric type, then use + and CTRL+x to select the aggregation function
  • aggregation column can be seen in the Column Sheet

1.8.2. One off calculations

  • z+ , then CTRL+x and then Enter

1.8.3. Pivot table

  • Select row(s) as key using !
  • + : If we want to specify the function, by default is count
  • Navigate to the column to be made columns in the pivot table and SHFT+w

1.9. Filter

  • " (once selected, creates copy)
  • Once we get freq sheet using SHFT+F, we can select multiple rows and create a new sheet out of them using g+Enter

2. Links

Created: 2024-07-16 Tue 16:44

Validate