nowfound

Dev tools · January 31, 2017

AC

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 →
  • AI
    An interactive introduction to Awk2021 · n8ta.com · ▲40
  • AJ
    Awk-JVM – A toy JVM in Awk2020 · github.com · ▲180
  • SS
    SPyQL – 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…

  • SI
    Strawk – 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…

  • TufteJun 2026 · ▲87

    CDN and Node package to generate ASCII graphs inline

  • FC

More dev tools this month

the category →
  • Dograh592

    The open source VAPI alternative

    Dev tools · 25d ago · dograh.com

  • Meridian530

    Don't let your work go unnoticed. Get promoted!

    Dev tools · 20d ago · meridiona.com

  • x1516

    Lovable for iPhone apps go from idea to App Store

    Dev tools · 11d ago · x1.new

  • 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

  • Nuphos380

    The AI-Native DevOps Workspace.

    Dev tools · 24d ago · nuphos.ai

Launched alongside, January 2017

the whole month →