Not that OP will see this, but if we’re talking plaintext here, awk and uniq will get you there effectively.
Awk to select column based on whatever the delimiter is, and uniq does exactly what it says.
Not in front of a terminal, but that’s probably enough info to copypasta something working or easily fixable from SO.