Skip to main content

AWK + stdlib + Rust

The AWK you know,
for the data you have now.

zawk runs your AWK programs, compiled with Cranelift, and adds CSV, JSON, Parquet, Excel, databases, S3 and NATS as input, ~190 standard library functions, modern syntax, and tooling built for AI agents.

brew install linux-china/tap/zawk
$ zawk '$FI["age"] > 20 { print $FI["name"], $FI["age"] }' \
    'mysql://root:***@127.0.0.1:3306/test#people'
Jackie 48
Love 48
Leo 24

$ zawk -i parquet 'NR <= 2' people.parquet
{"id":1,"name":"Jackie","age":48}
{"id":2,"name":"Love","age":48}

$ echo hello | zawk '{ print ulid(), encode("base64", $0), mask("abc@example.com") }'
01M60KH8PG6NM4HE8ZKQKXSAXT aGVsbG8= abc*********com

Reads and writes

  • CSV / TSV
  • JSON Lines
  • Parquet
  • Excel
  • Markdown
  • SQLite
  • MySQL
  • PostgreSQL
  • S3
  • HTTP
  • NATS
  • gz · zst · xz

Modern syntax, still AWK

f-strings, raw strings, ??, try … else, match expressions,local variables, key-value loops, ranges, !in and negative field indexes. Existing AWK programs keep their meaning.

Explore the syntax →
{ print f"{NR:>4}: {toupper($2):<10} {$3 * 1.1:,.2f}" }
{ sql = f"SELECT * FROM {table} WHERE id = {$1}" }

Start with a one-liner

Install zawk and point it at a file you already have.