Sean Kelly
Sean Kelly

Reputation: 1

Fully remove the non-unique values

I have an input CSV with a column similar to the below

1334
1334
3556
3556
3558
4897
4897
5978
6001
6001

Unlike a unique modifier for sort, I'm attempting to completely remove all the duplicates, so the only values that remain are ones that only appear one time, like the below

3558
5978

Upvotes: 0

Views: 193

Answers (1)

Mickey Cohen
Mickey Cohen

Reputation: 1277

Here's one-liner for what @Lee_Dailey suggested:

Get-Content -Path $PathToCSV | Group-Object | Where-Object -FilterScript { $_.Count -eq 1 } | Select-Object -ExpandProperty Name

Upvotes: 1

Related Questions