join -t, -1 1 -2 1 <(sort -t, -k1,1 ids.csv) <(sort -t, -k1,1 scores.csv)

Category: Data Science & Analysis

join -t, -1 1 -2 1 <(sort -t, -k1,1 ids.csv) <(sort -t, -k1,1 scores.csv)

Sort two CSVs in-process, then join them

Process substitution (<(...)) runs each sort command and presents its output as a file-like stream, so the join receives already-sorted inputs. Sorting on the key is required because join demands sorted files. This one-liner turns two unsorted CSVs into a joined result without intermediate files. The -k1,1 key ensures sorting only on the first field.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.