Skip to content

Latest commit

 

History

History
67 lines (50 loc) · 1.12 KB

slice.md

File metadata and controls

67 lines (50 loc) · 1.12 KB
title slice
categories filters
version 0.116.0
filters Return only the selected rows.
usage Return only the selected rows.
editLink false
contributors false

slice for filters

Return only the selected rows.

Command Type

built-in

Signature

> slice {flags} (rows)

Parameters

  • rows: Range of rows to return.

Input/output types:

input output
list<any> list<any>

Examples

Get the last 2 items.

> [0,1,2,3,4,5] | slice 4..5
╭───┬───╮
│ 0 │ 4 │
│ 1 │ 5 │
╰───┴───╯

Get the last 2 items.

> [0,1,2,3,4,5] | slice (-2)..
╭───┬───╮
│ 0 │ 4 │
│ 1 │ 5 │
╰───┴───╯

Get the next to last 2 items.

> [0,1,2,3,4,5] | slice (-3)..-2
╭───┬───╮
│ 0 │ 3 │
│ 1 │ 4 │
╰───┴───╯