nushell/docs/commands/drop_nth.md
Justin Ma c0a1d18e3d
update #4455, regenerate commands' docs and update make_docs script (#4586)
* feat: update #4455, regenerate commands' docs

* chore: update make_docs script
2022-02-21 11:26:00 -06:00

731 B

title layout version
drop nth command 0.59.0

Drop the selected rows.

Signature

> drop nth (row number or row range) ...rest

Parameters

  • row number or row range: the number of the row to drop or a range to drop consecutive rows
  • ...rest: the number of the row to drop

Examples

Drop the first, second, and third row

> [sam,sarah,2,3,4,5] | drop nth 0 1 2

Drop the first, second, and third row

> [0,1,2,3,4,5] | drop nth 0 1 2

Drop rows 0 2 4

> [0,1,2,3,4,5] | drop nth 0 2 4

Drop rows 2 0 4

> [0,1,2,3,4,5] | drop nth 2 0 4

Drop range rows from second to fourth

> echo [first second third fourth fifth] | drop nth (1..3)