Skip to main content

Copying and Pasting Rows

VisiData's clipboard operations work on rows and cells. Yank (copy) rows to an internal clipboard, then paste them elsewhere. Cut removes the row and yanks it in one step.

Learning Focus

Master the yank-paste workflow (yp) for duplicating rows. Use zy + gzp to copy-paste individual cell values across a column.

Yank (Copy) and Paste Rows

y # yank (copy) current row to internal clipboard
gy # yank all selected rows
Y # yank current row to system clipboard (needs xclip)
p # paste yanked rows after current row
P # paste yanked rows before current row

Duplicate a row:

# Move cursor to the row you want to copy
y # yank it

# Go to end of sheet
gG

# Paste
p # row is duplicated at the end

# Edit the copy
e # change values as needed

Yank multiple rows:

# Select all 'active' rows
|
# Enter: active

# Yank all selected
gy

# Navigate to destination
p # paste all yanked rows

Cut and Move Rows

x # cut (yank + delete) current row
gx # cut all selected rows
# Move a row to a different position
# Move cursor to the row
x # cut it

# Navigate to target position
p # paste after current row

Cell-Level Copy and Paste

Copy a single cell value and paste it into an entire column for selected rows.

zy # yank (copy) current cell value only
zY # yank current cell value to system clipboard
gzp # paste yanked value into current column for selected rows

Fill empty cells with a value:

# Move cursor to a cell containing 'sg'
zy # yank 'sg'

# Select rows with empty region
z|
# Enter: region == ""

# Paste into their region column
# Move to 'region' column
gzp # all selected rows now have 'sg'

Copy a tax rate to every row:

# Move to cell containing 0.07
zy

# Move to 'tax_rate' column
gs # select all rows
gzp # paste 0.07 into every row

Quick Reference

KeyAction
yYank (copy) current row
gyYank all selected rows
YYank to system clipboard (needs xclip)
pPaste yanked rows after current row
PPaste yanked rows before current row
xCut current row (yank + delete)
gxCut all selected rows
zyYank current cell value only
zYYank cell value to system clipboard
gzpPaste cell value into column for selected rows

Hands-On Practice

vd ~/github/practice-folder/visidata/01-loading/01-employees.csv

# 1. Duplicate a row: move cursor → y → gG → p
# 2. Cut and move: move cursor → x → navigate → p
# 3. Fill a value: move to 'sg' cell → zy → select rows → gzp

What's Next