VisiData - my new spreadsheet editor

Screenshot of VisiData https://www.visidata.org/

The "What"

VisiData is a a terminal-based spreadsheet editor. Think of it like Excel in the terminal, but faster, and more powerful.

It can open CSV and XLSX files, view, filter, aggregate and display graphs.

It can also open JSON, JSONL, structured logs, YAML, pandas and much more.

The "Why"

If you've ever tried to open a large (I'm talking millions of rows) CSV file in LibreOffice Calc or Excel, then you know it takes ages, uses up a ton of ram and slows your computer down.

On the other hand, VisiData quickly opens files and allows you to start working on them instantly.

I've also found it extremely useful for reading jsonl log files the programs I work with produce. I can quickly filter logs to get to the ones I need to debug an issue, or check if a processes has completed and with what success rate.

The "How"

In this section, I'm going to quickly go over how I process some logs from kubernetes.

  1. grab the logs and pipe them into VisiData kubectl logs $(firstpod) | grep '^{'` | vd. The grep portion simply filters out any lines that are not JSONL (because they don't start with the { character.
  2. Since my logs come from a python application, each log has a logger datapoint. I move to that column and apply a regex filter -> select by typing |application-name
  3. I create a new sheet with just the selected rows by pressing "
  4. Optionally, I can focus on a specific log line with the enter key and go back with the q key.

The VisiData documentation is well written and can get you started quickly. Once you are up and running, you can use this cheatsheet I found to help remember key-binds.

This article was updated on March 21, 2024