Jacky's blog
首页
  • 学习笔记

    • web
    • android
    • iOS
    • vue
  • 分类
  • 标签
  • 归档
收藏
  • tool
  • algo
  • python
  • java
  • server
  • growth
  • frida
  • blog
  • SP
  • more
GitHub (opens new window)

Jack Yang

编程; 随笔
首页
  • 学习笔记

    • web
    • android
    • iOS
    • vue
  • 分类
  • 标签
  • 归档
收藏
  • tool
  • algo
  • python
  • java
  • server
  • growth
  • frida
  • blog
  • SP
  • more
GitHub (opens new window)
  • shell

  • tool

    • mac 百问记录
    • mac tool
    • tmux
    • c tool
    • platform
    • VisiData 终极生存指南(vd)
      • Opening Files
        • Compatible filetypes
        • 追加打开
      • navigation
      • sheets
        • Understanding Sheets
      • columns
        • Understanding Columns
        • Set column types
        • createing new columns
        • create an expression column
        • create new columns by splitting another one
      • reshaping Data
      • other
        • suspend and recovery
      • 2.4.3 数据统计与筛选
        • 2.5 使用 pyobj
      • link
    • dev tool
    • java tool
    • IDEA
    • vscode
    • Docker 使用指南
    • unbuntuOnWindows
    • oh-my-zsh
    • github
    • lldb
    • ripgrep 高性能文本搜索工具使用指南
    • appium
    • mvn
    • ffmpeg
    • gradle
    • git 使用指南
    • jenv
    • php-fpm
    • raycast
    • Vim 编辑器入门指南
    • jadx
    • excalidraw 入门指南
    • whimsical 入门指南
    • mermaid 入门指南
  • 网络

  • compute_base

  • blog

  • growth

  • java

  • C&C++

  • ai

  • secure

  • cms

  • english

  • 生活

  • 金融学

  • more

  • other
  • tool
Jacky
2026-04-27
目录

VisiData 终极生存指南(vd)

# 🛠️ VisiData (vd) 终极生存指南

一句话简介:VisiData 是终端里的“交互式 Excel”,能极速处理 GB 级的 JSON、CSV、Excel 和数据库文件,是硬核开发者分析数据的降维打击工具。


# Opening Files

https://jsvine.github.io/intro-to-visidata/basics/opening-files/ (opens new window)

vd <file>
vd - < sample.tsv

# launch the DirSheet, navigate to the file you wish to load, and press Enter.
vd .

# 把当前系统所有运行中的进程详细列表,直接管道输送给 VisiData (vd) 进行交互式表格解析
ps aux | vd

# specify the file’s format。 打开两个文件,并指定格式
vd -f csv data.txt -f "" other.jsonl

# Loading sources supported by pandas
vd -f pandas data.parquet
1
2
3
4
5
6
7
8
9
10
11
12
13
14

# Compatible filetypes

# 追加打开

操作步骤

  1. 在当前 VisiData 界面中,按下 o(小写字母 o,代表 Open)。
  2. 此时屏幕底部会弹出输入框 open: ,并带有路径补全功能。
  3. 输入你想追加的文件路径(支持相对路径或绝对路径,如 ../data/new_stock.csv),然后回车。
  4. 效果:新文件会立刻被加载并展现在你面前。

# navigation (opens new window)

  • move faster
    • gj: to last row
    • gk: to first row
    • gh: to leftmost column
    • gl: to rightmost column
    • Control-F: one page down (forward)
    • Control-B: one page up (backward)
  • move via searching
    • n: Move to next matching row;
    • N: Move to previous matching row
    • c + regex: Jump to the next matching column
  • move to a specific row/column number
    • zr + n: Jump to row number n
    • zc + n: Jump to column number n
  • Alt + H: 帮助
  • U: 撤销最近的修改,跟VIM一样

快捷键不需要刻意记,使用下面方案可能是一种比较好的选择

使用 tmux 分屏打开vd的帮助文档,具体操作如下:

  1. 进入tmux window. 使用 C-b + % 开启左右分屏
  2. 定位到新开的pane中,屏使用 vd -h | vim -专门用于搜索快捷键。这样就不用记这些快捷键了。

这样就可以左边使用vd工作操作数据,右边查vd相关的命令啦

# sheets

# Understanding Sheets (opens new window)

  • Shift-S: open the Sheets Sheet from anywhere in VisiData
  • gS: open Sheets Sheet, which contains all sheets from current session, active and inactive
  • Control-^: Quickly toggling between sheets: flip back and forth between your current sheet and the previous one
  • rename a sheet
    • e: 在Sheets列表中,选中sheet,然后按此键

# columns

# Understanding Columns (opens new window)

  • c + <column_name>: 跳转到column
  • view all columns and their attributes
    • Shift-C
  • rename a column
    • ^
  • expand, shrink, and remove columns
    • _: Expands the width of current column to fit text in all visible rows
    • -: hide the current column
    • gv: unhide all columns on current sheet
    • z-: Shrinks the current column’s width in half
  • manipulate columns
    • !: pins the current column on the left as a key column
    • H L: slides the current column one position to the left/right
    • gH gL: slides the current column all the way to the left/right of its section
  • expand columns that contain nested data
    • (: expand current column
    • ): contract (unexpand) the current column
  • create derivative columns
    • =: takes a Python expression as input and creates a new column
    • 自定义配置命令: 强大, 可以在帮助列表中查找到

# Set column types

快捷键 (Command) 数据类型 (Type) 备注/适用场景
~ string 字符串/文本格式(默认)
# int 整数类型(适合数量、ID等)
% float 浮点数类型(适合带小数点的比例、指标)
$ currency 货币类型
@ date 日期类型(时间序列分析必备)
z# vlen 变长/向量长度类型
z~ anytype 任意/混合类型

# createing new columns (opens new window)


# create an expression column

DEMO: 根据list_date一列,过滤出在2000年上市的公司

  1. 将光标移动到 list_date 这一列上,按下快捷键 @。把这一列的每一行都当做真正的 Python datetime.date 对象来理解
  2. 输入=list_date.year < 2000,然后按 Enter.

# create new columns by splitting another one

  1. navigate to that column, and press :.

# reshaping Data (opens new window)

# other

# suspend and recovery

需要说明操作的不是vd独有的,使用了macOs的内置命令完成

  • Ctrl + Z: 触发 suspend
  • jobs: 查看当前后台所有任务
  • fg %1: 回到前台, 指定序号的job,捞回前台

# 2.4.3 数据统计与筛选

不用写复杂的 SQL 或 Python 脚本,几个按键搞定报表统计。

  • 频率统计 (Frequency):选中一列,按 Shift + F。
    • 用途:瞬间生成该列数据的分布图,一眼看出哪些值出现次数最多。
  • 快速排序:按 [ (升序) 或 ] (降序)。
  • 正则筛选:
    1. 按 | 输入正则,匹配的行会变色(被选中)。
    2. 按 " (双引号),新开一个窗口只显示刚才选中的行。
  • 数值计算:按 + 后输入 sum / avg / max,在底部状态栏查看结果。

# 2.5 使用 pyobj

  • Ctrl+X: evaluate Python expression and open result as Python object

示例1:查找注册资本(reg_capital)大于 500,000 的企业

  1. 移动光标至 reg_capital 列,按下 # (或 %) 转换为数字类型。
  2. 按下快捷键 Ctrl + x 唤出底部 Python 输入框。
  3. 输入 [r for r in sheet.rows if r.reg_capital > 500000] 并回车,即可生成独立的过滤结果对象表。

💡 小贴士:在 VisiData 中遇到困难?随时按下 Ctrl + H 唤起内置帮助文档。

# link

  • VisiData (opens new window)
    • man (opens new window)
  • intro-to-visidata (opens new window) important
#tool#shell#data
上次更新: 2026/05/21, 21:58:29
platform
dev tool

← platform dev tool→

最近更新
01
cloudeflare
06-07
02
Android 端口转发(Forward & Reverse) 的实操与避坑全指南
04-29
03
macOS 定时任务实现:Git 仓库状态自动同步方案
04-26
更多文章>
Theme by Vdoing | Copyright © 2019-2026 Jacky | MIT License
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式