#words #position #command-line-tool #print #input #file-input #stdin

app wd

wd - a command line tool for print specified position of words

4 releases

0.1.3 May 16, 2021
0.1.2 May 15, 2021
0.1.1 May 15, 2021
0.1.0 May 15, 2021

#12 in #file-input

MIT/Apache

5KB
76 lines

wd

wd - a command line tool for print specified position of words

Inpired by https://github.com/onsd/wd

Installation

cargo install wd

Usage

stdin

echo "a b c" | wd -n 1 2
# a b
echo "a b c" | wd -n 1 3
# a c

file input

cat some.txt
# abc def
wd --input some.txt --number 1
# abc
wd -i some.txt -n 2
# def

with exa

exa is modern ls made by Rust.

exa -l
# .rwxrwxrwx 5.9k ssssota 15 May 19:42 Cargo.lock
# .rwxrwxrwx  252 ssssota 15 May 19:42 Cargo.toml
# .rwxrwxrwx  335 ssssota 15 May 19:45 README.md
# drwxrwxrwx    - ssssota 15 May 18:19 src
# drwxrwxrwx    - ssssota 15 May 18:53 target
exa -l | wd -n 1 7
# .rwxrwxrwx Cargo.lock
# .rwxrwxrwx Cargo.toml
# .rwxrwxrwx README.md
# drwxrwxrwx src
# drwxrwxrwx target

custom delimiter

cat some.csv
# a,b,c
# 1,2,3
# 4,5,6
cat some.csv | wd -d "," -n 1 3
# a c
# 1 3
# 4 6

Dependencies

~2.5MB
~48K SLoC