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

'hasOwnProperty' in javascript -

python - ValueError: No axis named 1 for object type <class 'pandas.core.series.Series'> -

java - How to provide dependency injections in Eclipse RCP 3.x? -