Column Editing
Column editing commands modify the values inside existing columns in-place. Unlike Adding Columns (which adds new columns), these commands change the data directly.
Use g= for bulk transformations with Python, ge for setting a literal value, f to fill nulls downward, and g* to regex replace values in-place. All are undoable with U.
Bulk Set with Python Expression (g=)
Set the current column for all selected rows to the result of a Python expression.
g= expr # set current column for SELECTED rows to expression result (in-place)
gz= expr # set current column for CURRENT row only (in-place)
# Select all Engineering rows
|
# Enter: Engineering
# Uppercase their department
g=
# Enter: department.upper()
# Normalize region codes
# Select all rows with gs
gs
g=
# Enter: 'sg' if region == 'singapore' else region
Destructive but undoable with U.
Bulk Set with Literal Value (ge)
Set the current column for all selected rows to a fixed text value.
ge text # set current column for selected rows to literal text
# Set all selected rows' 'status' column to 'inactive'
ge
# Enter: inactive
# Clear a column for selected rows
ge
# Enter: (leave blank)
Regex Replace In-Place (g*, gz*)
Apply a regex replacement directly to existing values.
g* search<Tab>replace # modify current column for selected rows
gz* search<Tab>replace # modify ALL visible columns for selected rows
# Normalize status labels across selected rows
gs
g*
# Enter: active<Tab>ACTIVE
# Strip trailing whitespace from all columns for selected rows
gs
gz*
# Enter: \s+$<Tab>
For creating a NEW column with regex replace (keeping the original), see Splitting and Extracting.
Fill Nulls (f)
Fill null cells in the current column with the non-null value from the row above.
f # fill null cells in current column from above
# A column has sporadic nulls:
# region: sg, null, null, kl, null, jp
# Move to 'region' column
f
# Result: sg, sg, sg, kl, kl, jp
Copy / Paste Columns (Y, gY, gP)
Copy and paste entire columns. These operations work from the Columns Sheet.
Y # yank (copy) current column row (in Columns Sheet)
gY # yank all selected column rows (in Columns Sheet)
gP # paste previously yanked column(s) (in Columns Sheet)
See Columns Sheet Operations for details.
Cell Yank / Paste (zy, gzp)
Copy a single cell value and paste it into an entire column.
zy # yank (copy) current cell value
gzp # paste yanked value into current column for selected rows
# Copy a tax rate from a cell
# Move to cell containing 0.07
zy
# Apply it to all rows in 'tax_rate' column
# Move to 'tax_rate' column
gzp
External Editor (g^O)
Open the current column for selected rows in your system $EDITOR (one value per line).
g^O # edit current column for selected rows in external editor
# Select rows with messy data
gs
# Edit all values in 'notes' column at once
g^O
# Your editor opens with one value per line — edit, save, quit
Quick Reference
| Key | Action | Destructive? |
|---|---|---|
g= expr | Set column for selected rows to Python expr | Yes — undo with U |
gz= expr | Set current row only to Python expr | Yes — undo with U |
ge text | Set column for selected rows to literal | Yes — undo with U |
f | Fill null cells from row above | Yes — undo with U |
g* s<Tab>r | Regex replace in-place (selected rows) | Yes — undo with U |
gz* s<Tab>r | Regex replace in all visible columns (selected) | Yes — undo with U |
Y | Yank column (Columns Sheet) | No |
gY | Yank selected columns (Columns Sheet) | No |
gP | Paste yanked columns (Columns Sheet) | Yes |
zy | Yank current cell value | No |
gzp | Paste yanked value to column (selected rows) | Yes — undo with U |
g^O | Edit column in external editor (selected rows) | Yes — undo with U |
What's Next
- Splitting and Extracting — split a column into multiple new columns
- Deleting and Hiding — remove or hide columns