I have 2 CSV files with same headings, i need to compare both and remove duplicates from one file. for example
CSV1:
RollNo Class Name School 100 X Raja XYZ 101 Y Krish XYZ 102 A Joe ABC
CSV2:
RollNo Class Name School 200 B Puja XYZ 100 X Raja XYZ 201 B Jery ABC
The output expecing is as below (only From CSV1)
RollNo Class Name School 101 Y Krish XYZ 102 A Joe ABC
Can somebody put a light in to it.
I was trying with Compare-Object
, but it confuses me a lot.
Compare-Object $csv1 $csv2 -Property RollNo,Class,Name,School -
IncludeEqual -ExcludeDifferent |select * -ExcludeProperty
SideIndicator | Export-Csv School.csv -NoTypeInfo