💾 Archived View for heavysquare.com › unix › 9944-efficiently-select-lines-from-file.txt captured on 2021-12-03 at 14:04:38.

View Raw

More Information

-=-=-=-=-=-=-


~~ 2021-07-22T23:45:24+02:00

$ cat lines
3
1
8
$ cat data
50b30194-e986-4841-b6ac-13f09fbe0d1a
96992320-3716-48b9-8a35-d0e61857cca5
de3e4f5f-134a-48b2-8ab7-e8b2fc2ca104
d607aae6-fabd-40a2-9352-fc4d26514dcb
35b23721-1eb9-4973-b980-70918fdb4f44
f33d6d28-c387-473a-8b19-a58141f28c85
25336069-9dfd-4594-9de8-2a9449015a76
c03b8667-3fab-4fff-9a48-4d0572a2cf26
e9b91ff3-bc70-48ca-a375-5aa600eb6f57
4855bcfa-cd53-4763-b6c9-0e980a4c44e7
$ join --nocheck-order -t 


\t' <(sort -g lines) <(nl -w1 data) | cut -f2-
50b30194-e986-4841-b6ac-13f09fbe0d1a
de3e4f5f-134a-48b2-8ab7-e8b2fc2ca104
c03b8667-3fab-4fff-9a48-4d0572a2cf26
$