#sample #text-file #plain-text #cli #rand

app samples

sample lines from a text file(plain text, csv, log...) or from stdin

1 stable release

1.0.5 Apr 28, 2024

#443 in Command line utilities

Download history 108/week @ 2024-04-22 43/week @ 2024-04-29

151 downloads per month

Apache-2.0

6KB

samples is a rust cli tool to sample lines from a text file(plain text, csv, log...) or from stdin

Installation

Cargo

cargo install samples

Manual

# download from github release
wget https://github.com/zhangtaomox/samples/releases/download/v1.0.5/samples-{YOUR PLATFORM}

Usage

# from stdin
echo "1\n2\n3\n4\n5" | samples -k 2
5
1
# from a file
samples -k 2 example.txt
# pipe
cat example.txt | samples -k 2 > output.txt

License

MIT or Apache-2.0

Dependencies

~3MB
~55K SLoC