Skip to content

Commit

Permalink
slice: add examples
Browse files Browse the repository at this point in the history
[skip ci]
  • Loading branch information
jqnatividad committed Aug 13, 2024
1 parent 68420f0 commit 04afaa3
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/cmd/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,35 @@ slice options:
JSON array. If --no-headers is set, then
the keys are the column indices (zero-based).
Examples:
# Slice from the 3rd record to the end
qsv slice --start 2 data.csv
# Slice the first three records
qsv slice --start 0 --end 2 data.csv
qsv slice --len 3 data.csv
qsv slice -l 3 data.csv
# Slice the last record
qsv slice -s -1 data.csv
# Slice the last 10 records
qsv slice -s -10 data.csv
# Slice the first three records of the last 10 records
qsv slice -s -10 -l 3 data.csv
# Slice the second record
qsv slice --index 1 data.csv
qs slice -i 1 data.csv
# Slice the from the second record, two records
qsv slice -s 1 --len 2 data.csv
# Slice records 10 to 20 as JSON
qsv slice -s 9 -e 19 --json data.csv
qsv slice -s 9 -l 10 --json data.csv
Common options:
-h, --help Display this message
-o, --output <file> Write output to <file> instead of stdout.
Expand Down

0 comments on commit 04afaa3

Please sign in to comment.