Powershell : Find duplicates

Powershell: Script to find duplicates

Hello experts,

I have 2 files, FileA and FileB

FileA

Login, attribute1,attribute2
test1234,xyz,345
nest1234,xyzz,3456

FileB
nest1234,xyzz,3456

I need an output that contains FileA - FileB. The Results file should contain
test1234,xyz,345

Thanks for your help.
Parity123Asked:
Who is Participating?
 
oBdACommented:
$FileA = 'C:\Temp\FileA.csv'
$FileB = 'C:\Temp\FileB.csv'
$FileC = 'C:\Temp\FileC.csv'

$FileBLogins = Import-Csv -Path $FileB | Select-Object -ExpandProperty Login
Import-Csv -Path $FileA | Where-Object {$FileBLogins -notcontains $_.Login} | Export-Csv -NoTypeInformation -Path $FileC

Open in new window

1
 
Parity123Author Commented:
Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.