awk commands for `union`, `intersect`, `except`, `extra`
I'm munging text and I wrote these awk commands that may be useful to other coders. Feedback welcome. union (https://github.com/sixarm/union): print lines in (A union B) intersect (https://github.com/sixarm/intersect): print lines in (A intersect B) except (https://github.com/sixarm/except): print lines in (A except B) a.k.a. (A - B) extra (https://github.com/sixarm/extra) : print lines in (A extra B) a.k.a. (B - A) Examples: $ cat 1.txt alpha bravo $ cat 2.txt alpha charlie $ union 1.txt 2.txt alpha bravo…
What it does
In the maker’s words, at launch
I'm munging text and I wrote these awk commands that may be useful to other coders. Feedback welcome. union (https://github.com/sixarm/union): print lines in (A union B) intersect (https://github.com/sixarm/intersect): print lines in (A intersect B) except (https://github.com/sixarm/except): print lines in (A except B) a.k.a. (A - B) extra (https://github.com/sixarm/extra) : print lines in (A extra B) a.k.a. (B - A) Examples: $ cat 1.txt alpha bravo $ cat 2.txt alpha charlie $ union 1.txt 2.txt alpha bravo charlie $ intersect 1.txt 2.txt alpha $ except 1.txt 2.txt bravo $ extra 1.txt 2.txt charlie
Does the same job
all alternatives →- AIAn interactive introduction to Awk2021 · n8ta.com · ▲40
- AJAwk-JVM – A toy JVM in Awk2020 · github.com · ▲180
- SSSPyQL – SQL with Python in the middle2022 · github.com · ▲105
SPyQL (https://github.com/dcmoura/spyql) is SQL with Python in the middle, an open-source project fully written in Python for making command-line data processing more intuitive, readable and powerful. Try mixing in the same pot: a SQL SELECT for providing the structure, Python expressions for defining transformations and conditions, the essence of awk as a data-processing language, and the JSON handling capabilities of jq. How does a SPyQL query looks like? $ spyql “ IMPORT pendulum AS p SELECT (p.now() - p.from_timestamp(purchase_ts)).in_days() AS days_ago, sum_agg(price…
- SIStrawk – I implemented Rob Pike's forgotten AwkNov 2025 · ▲5
Rob Pike wrote a paper, Structural Regular Expressions (https://doc.cat-v.org/bell_labs/structural_regexps/se.pdf), that criticized the Unix toolset for being excessively line oriented. Tools like awk and grep assume a regular record structure usually denoted by newlines. Unix pipes just stream the file from one command to another, and imposing the newline structure limits the power of the Unix shell. In the paper, Mr. Pike proposed an awk of the future that used structural regular expressions to parse input instead of line by line processing. As far as I know, it…

- FCFlexible command line tool to create graphs from CSV data2018 · github.com · ▲95
More dev tools this month
the category →



Open-source GTM skills for technical founders
Dev tools · 29d ago · gtmcofounder.com

OpenTrailPaper is open-source bike computer firmware for the LilyGO T5S3 4.7" E-Paper PRO. It supports offline maps, GPX routes, FIT recording and Bluetooth sensors.
Dev tools · 1d ago · opentrailpaper.com

Launched alongside, January 2017
the whole month →
Unsplash 5.0▲1,501Free (do whatever you want) high-resolution photos.
Dev tools · 2017 · unsplash.com
- PF
Life & fun · 2017 · skytorrents.in
- AA
Dev tools · 2017 · blog.jwilm.io
Opera Neon▲894A concept of tomorrow’s web browser you can play with today.
Life & fun · 2017 · operaneon.com
Founderkit▲857Unbiased reviews of startup tools from experienced founders
Dev tools · 2017 · founderkit.com
