Lets say we have the below 2 csv files. Lookup Account filed in CSV2 on GL_Account.csv and get the unmatched records from CSV2

# GL_Distinct_Values.csv
Account
111111
222222
333333
444444

# test_Cln.csv
Account
111111
999222
333333
477444

required out put
Account

999222
477444

Compare-Object -ReferenceObject (get-content -path “.\Desktop\test_Cln.csv”) -DifferenceObject (get-content -path ‘.\Desktop\GL_Distinct_Values.csv’) |?{$_.sideindicator -eq ‘<='}

Advertisements