Page 1 of 1

Removing duplicates from a CSV file ( NOT unique values )

Posted: Wed Jun 12, 2019 10:11 am
by apowershelluser
I have a spreadsheet for lockouts. This lists mac addresses and a few other things

On the macaddress columns, it lists the MACs for their PC, phone, tablet, etc...
Sometimes this CSV file list the same mac addresses multiple times because the phone pings our wireless in attempt to reconnect and their PCs have stored managed credentials

What I'm looking for is the powershell way in excel for Remove Duplicates

When I choose -unique, well it gives me just one :D

Re: Removing duplicates from a CSV file ( NOT unique values )

Posted: Wed Jun 12, 2019 10:25 am
by jvierra
Excel has a deduplicating method built in. Just select what you want to dedupe and click the button.

In a CSV (a csv is not an Excel workbook it can just be viewed as such) you can use "Group-Object" to dedupe a Csv,

help group-object -online

Re: Removing duplicates from a CSV file ( NOT unique values )

Posted: Thu Jun 13, 2019 7:55 am
by apowershelluser
Hmm, that didn't really do what I was hoping, but I found a work around.. Thanks so much!