Skip to content

Instantly share code, notes, and snippets.

@paul-d-ray
Created October 11, 2025 22:33
Show Gist options
  • Select an option

  • Save paul-d-ray/506d156bfb0aa00c7c9e3de14cf9d6fc to your computer and use it in GitHub Desktop.

Select an option

Save paul-d-ray/506d156bfb0aa00c7c9e3de14cf9d6fc to your computer and use it in GitHub Desktop.
Visidata DateTime column Filter or Split

Filter on a Date Column

to filer on a date field do the following steps

  • make sure the import datetime is in the .visidatarc file.
  • format the date column with @ to let visidata know it is a date column.
  • be in the column, and do a filter z|
  • key in the command
    DATE_FIELD_NAME > datetime.date(YYYY,M,D)
    INCIDENT_DATE > datetime.date(2016,1,1)

Split a Date Column into Year, Month, Day Columns

To split a date column into separate year, month, and day columns in VisiData, navigate to the relevant date column and use the split function with a regular expression. For dates formatted as "YYYY-MM-DD", make sure the date column is fomratted as "@".

  • Move to the date column you want to split.
  • Press : to open the split regex prompt.
  • Enter a hyphen character (-) to split the date at each hyphen (which is between year, month, and day).
  • Press Enter. The date column will split into a new columns containing the year, month, and day values as a list.
  • Enter ( to split the list into three columns.
  • Enter ^ to rename each of the new columns (Year Month Day)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment