#command-line-tool #data #utility #awk #row #regex #table-like

app ock

A simple, fast command line utility for working with table-like data

1 unstable release

0.1.0 Nov 20, 2022

#16 in #awk

MIT license

15KB
239 lines

ock

A simpler, faster replacement for most awk use cases, ock is a command line utility for working with table-like data.

Installation

git clone https://github.com/williamwmarx/ock
cd ock
cargo build

Usage

Select a column

ps aux | ock -c 2
ps aux | ock -c pid

Select a row

ps aux | ock -r caffeinate

Selecting ranges

ps aux | ock -c pid -r 0:10

Selecting multiple ranges

ps aux | ock -c name, pid -r 0:10

Regex

ps aux | ock -c name, pid -r "python(2|3)"

Delimiters

ock  -r 1:10:2 -c 1,5 --column-delimiter "," data.csv

Dependencies

~3.5–5MB
~87K SLoC