The following employee
matrix of names and email addresses makes it visually clear that bob
's email address is bob@example.com
.
┌───────┬─────────────────────┐
│alice │alice@example.com │
├───────┼─────────────────────┤
│bob │bob@example.com │
├───────┼─────────────────────┤
│charlie│charlie47@example.com│
└───────┴─────────────────────┘
But how do I programmatically access the email address based on a given value in column 1? The best approach I've found so far is
(⊂'bob') {(⍵[;1]⍳⍺) 2 ⌷⍵} employees
This works, but is pretty verbose—I feel like I must be missing a much simpler way to do something that I would imagine to be fairly common.
Any tips on what I'm missing?