Searching and Jumping
VisiData has three search modes: regex search in the current column, regex search across all columns, and Python expression search. Each serves a different precision need.
Learning Focus
Learn the difference between / (column search), g/ (all columns), and z/ (Python expression). These three cover every data-finding scenario.
Regex Search
Search in Current Column
/ regex search forward in current column's displayed values
? regex search backward in current column's displayed values
n go to next match
N go to previous match
Example:
# Move cursor to 'status' column
# Press / and type: error
# Cursor jumps to first row where status contains "error"
# Press n to go to next match
# Press N to go to previous match
Search Across All Columns
g/ regex search forward in ALL visible columns
g? regex search backward in ALL visible columns
Example:
# Find any row where any column contains "192.168"
g/
# Enter: 192.168
# Cursor jumps to first match in any column
Python Expression Search
z/ expr search forward by Python expression in current column
z? expr search backward by Python expression
The expression uses column names as variables:
# Find rows where age > 30
z/
# Enter: age > 30
# Find rows where salary > 50000 and city == 'Singapore'
z/
# Enter: salary > 50000 and city == 'Singapore'
# Find rows where hostname starts with 'web'
z/
# Enter: hostname.startswith('web')
warning
Python expression search requires the column type to be correctly set. If age is a string type, age > 30 will do a string comparison. Cast to # (int) first.
Jump to Row by Key
r regex go to next row whose key column matches regex
c regex go to next column whose name matches regex
Search Workflow
Practical Use Cases
Find Error Rows in a Log
vd /var/log/nginx/access.log
# Search for 500 errors in status column
# Move cursor to status column
/
# Enter: 500
# Press n to cycle through all 500 errors
Find IPs in a Specific Subnet
vd /var/log/nginx/access.log
# Search all columns for 192.168 subnet
g/
# Enter: 192\.168
Find High-Value Rows
vd /var/www/html/exports/orders.csv
# Set 'amount' column to float type first: press %
# Then search for large orders
z/
# Enter: amount > 10000
Find Null or Empty Values
# Find rows where 'email' column is empty
z/
# Enter: not email or email == ''
Column Name Search
# Jump to a column by name (partial regex match)
c
# Enter: date
# Cursor jumps to the first column whose name contains 'date'
Troubleshooting Matrix
| Problem | Cause | Fix |
|---|---|---|
| Search finds nothing | Column type mismatch | Cast column type first (#, %, etc.) |
| Expression syntax error | Typo in Python expr | Press Ctrl+C to cancel, try again |
g/ too slow on large files | Searching millions of rows | Use z/ with a specific expression to narrow |
| Regex not matching | Wrong regex syntax | Test regex in a shell: echo text | grep -P 'pattern' |
Best Practices
- Use
/for fast simple lookups; usez/for data quality checks with Python logic. - After finding target rows with
/, presssto select matching rows, then"to open a filtered sheet with only those rows. - For case-insensitive search, use regex:
/(?i)errormatchesError,ERROR,error.
Hands-On Practice
vd /var/log/syslog
# 1. Press / and search for: kernel
# 2. Press n to cycle through matches
# 3. Press g/ and search for: error
# 4. Press N to go backward through matches
# 5. Press z/ and try: len(row) > 100 (long lines)