powershell - Add a CSV content to another CSV -


i have 2 csv files, both have same header:

id,relation,first name,last name,email address,office,phone,photos 

i'm trying make powershell scrip copy 2nd csv file @ end of first, without header.

is there way eliminate duplicate records based on column, after added 2 together?

you can use group-object cmdlet group records on specific (or multiple) column. iterate on list using foreach-object , select first entry in each group give distinct list. can export csv using export-csv cmdlet:

import-csv "your-csv.path"  |      group -property 'id' |      foreach-object { $_.group | select -first 1} |     export-csv -path 'your_csv.path' 

Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -