If the input is
foo,bar,baz
bar,baz,qux
qux,quux,baz
bar,foo,qux
waldo,fred,garply
the output should be
foo,bar,baz
bar,baz,qux
waldo,fred,garply
As you can see, records are deduplicated based on the 3rd column's value. If multiple records have the same 3rd column value, pick a random one (or the first one; doesn't matter)