Comment

Comment by quicklime

If you're just looking for a single column, then as zamfi mentioned, cut does the job:

  $ paste <(printf "a\nb\nc\n") <(printf "1\n2\n3\n") | cut -f2
  1
  2
  3
It makes sense that "cut" and "paste" would be inverse operations, but too bad that GUIs repurposed these words for clipboard operations.

But awk can do both, and does so in a single pass:

  $ paste <(printf "a\nb\nc\n") <(printf "1\n2\n3\n") | awk '{ print $1 > "letters"; print $2 > "numbers" }'
  $ cat letters
  a
  b
  c
  $ cat numbers
  1
  2
  3
parent quicklime 4 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton