Returnini non-unique data from a csv file This topic contains 1 reply, has 1 voice, and was last updated by Gerald 1 year, 6 months ago. Author Posts April 20, 2015 at 12:45 pm #24469 GeraldParticipant I'm looking for a way to sort a csv file on unique values in 3 columns. In addition to returning the unique data, I also need to know what the non-unique(duplicate) data was so I can report on it(i.e. what was dropped). $uData below gives me the unique data I'm after – $data = import-csv $InputFile -header("A","B","C","D","E","F","G") $uData = import-csv $InputFile -header("A","B","C","D","E","F","G") | Sort C,D,E -unique To find the non-unique I tried a compare, though it is returning data that is unique, not that which was dropped – compare-object $data $uData -passthru | Select C,D,E | ft Any thoughts how how I can determine non-unique data in this scenario? Thanks April 20, 2015 at 12:53 pm #24470 GeraldParticipant Nevermind, found my issue. It should be – compare-object $zdata $Data -property C,D,E -passthru | ft Author Posts You must be logged in to reply to this topic.