Powershell:- Lookup a column data in another excel and get the unmatched records

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s