Editing Contents
How to edit cells
For a summary of all editing commands, see the man page.
Command | Operation |
---|---|
e |
edit contents of current cell |
ge text |
set contents of current column for selected rows to text |
g* regex/subst |
replace matching regex in current column for selected rows with subst |
g= expr |
evaluate Python expr over each selected row and set current column to the result |
While in editing mode, or anytime VisiData expects input (with e.g. =
, ;
), typical readline commands become available:
Command | Operation |
---|---|
Enter |
accepts input |
Ctrl+C /Esc |
aborts input |
Ctrl+O |
opens external $EDITOR to edit contents |
Ctrl+R |
reloads initial value |
Ctrl+A /Ctrl+E |
moves to beginning/end of line |
Backspace |
deletes previous character |
Up /Down |
sets contents to previous/next in history |
Tab /Shift-Tab |
autocompletes input (when available) |
How to rename columns
Command | Operation |
---|---|
^ |
edits name of current column |
g^ |
sets names of all unnamed visible columns to contents of selected rows (or current row) |
z^ |
sets name of current column to contents of current cell |
gz^ |
sets name of current column to combined contents of current column for selected rows |
In most cases, ^
is the preferred command. Examples which demo ^
can be seen in Columns and Group.
How to set the header in an Excel sheet?
For most filetypes (e.g. csv, tsv, xls(x)) the loaders assume that the dataset's first options.header
rows contain the column names.
If the Excel file has multiple sheets with varying number of header rows:
- Pass
--header=0
while loading the file.
vd file.xlsx --header=0
- For each sheet, press
s
ort
to select the rows which represent the header rows. - Press
g^
to set the names of the headers to the contents of selected rows.
How to rename headers using the Columns sheet
- Press
Shift+C
to open the Columns sheet. - Within the name column, move the cursor to the row which represents the source sheet.
- Type
e
and then input the new column name. PressEnter
. - Press
q
to return to the source sheet and see the renamed column.